zoran Posted August 25, 2009 Share Posted August 25, 2009 I would like to be able to access my mysql tables via cmd prompt. but when I type: C:\XAMPP\mysql\bin\mysql *.sql I get only one database displayed as being on the localhost. Quote Link to comment https://forums.phpfreaks.com/topic/171771-i-would-like-to-be-able-to-access-my-mysql-tables-via-cmd-prompt/ Share on other sites More sharing options...
trq Posted August 25, 2009 Share Posted August 25, 2009 mysql doesn't take a file name as an argument, what exactly are you trying to do? Quote Link to comment https://forums.phpfreaks.com/topic/171771-i-would-like-to-be-able-to-access-my-mysql-tables-via-cmd-prompt/#findComment-905746 Share on other sites More sharing options...
zoran Posted August 25, 2009 Author Share Posted August 25, 2009 I just want to display all my databases and tables in them using cmd (dos) prompt. I am new to this so I cant explain the command I typed as it came from a tutorial Quote Link to comment https://forums.phpfreaks.com/topic/171771-i-would-like-to-be-able-to-access-my-mysql-tables-via-cmd-prompt/#findComment-905753 Share on other sites More sharing options...
trq Posted August 25, 2009 Share Posted August 25, 2009 So... you login. mysql -u<uyourusername> -p you will get a mysql> prompt. Then, to view databases.... SHOW DATABASES; to view tables within a database..... USE databasename; SHOW TABLES; Quote Link to comment https://forums.phpfreaks.com/topic/171771-i-would-like-to-be-able-to-access-my-mysql-tables-via-cmd-prompt/#findComment-905758 Share on other sites More sharing options...
zoran Posted August 25, 2009 Author Share Posted August 25, 2009 I type in : C:\xampp\mysql> -u<'root'> -p and get '-u' is not a recognised as an external or internal command operable program or a batch file Quote Link to comment https://forums.phpfreaks.com/topic/171771-i-would-like-to-be-able-to-access-my-mysql-tables-via-cmd-prompt/#findComment-905764 Share on other sites More sharing options...
trq Posted August 25, 2009 Share Posted August 25, 2009 You should be using.... C:\xampp\mysql -uroot -p Quote Link to comment https://forums.phpfreaks.com/topic/171771-i-would-like-to-be-able-to-access-my-mysql-tables-via-cmd-prompt/#findComment-905766 Share on other sites More sharing options...
zoran Posted August 25, 2009 Author Share Posted August 25, 2009 does not work still... Quote Link to comment https://forums.phpfreaks.com/topic/171771-i-would-like-to-be-able-to-access-my-mysql-tables-via-cmd-prompt/#findComment-905770 Share on other sites More sharing options...
trq Posted August 25, 2009 Share Posted August 25, 2009 Weird. Try without any options then and see if it prompts you for a username / password. Quote Link to comment https://forums.phpfreaks.com/topic/171771-i-would-like-to-be-able-to-access-my-mysql-tables-via-cmd-prompt/#findComment-905772 Share on other sites More sharing options...
zoran Posted August 25, 2009 Author Share Posted August 25, 2009 I dont follow all I type is C:\xamp\mysql> -uroot -p what options do you meen? Quote Link to comment https://forums.phpfreaks.com/topic/171771-i-would-like-to-be-able-to-access-my-mysql-tables-via-cmd-prompt/#findComment-905778 Share on other sites More sharing options...
trq Posted August 25, 2009 Share Posted August 25, 2009 all I type is C:\xamp\mysql> -uroot -p There is no > after mysql, look again..... C:\xampp\mysql -uroot -p what options do you meen? -u and -p are options (or arguments) to the mysql command. Quote Link to comment https://forums.phpfreaks.com/topic/171771-i-would-like-to-be-able-to-access-my-mysql-tables-via-cmd-prompt/#findComment-905780 Share on other sites More sharing options...
zoran Posted August 25, 2009 Author Share Posted August 25, 2009 I dont know how to get cmd display the prompt without the > i.e. C:\xampp\mysql I use cd to change directories to go up, and cd C:\ to get all the way back and start again to the directory I want, so the prompt line is always ending with a > Quote Link to comment https://forums.phpfreaks.com/topic/171771-i-would-like-to-be-able-to-access-my-mysql-tables-via-cmd-prompt/#findComment-905838 Share on other sites More sharing options...
trq Posted August 25, 2009 Share Posted August 25, 2009 Ah now I see. So.... C:\xampp\mysql> Is your prompt? I thought that was what you where actually typing. Is the mysql command within the C:\xampp\mysql directory? If it is, go to that directory and type the command I showed you. This would mean the entire line would look like.... C:\xampp\mysql>mysql -uroot -p Including the prompt. Quote Link to comment https://forums.phpfreaks.com/topic/171771-i-would-like-to-be-able-to-access-my-mysql-tables-via-cmd-prompt/#findComment-906253 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.