I am using debian linux. I have a linux machine on which mysql is install. I can log in to my linux machine using root user as well as other user. I can connect to mysql dat
you should use mysql
command. It's a command line client for mysql RDBMS, and comes with most mysql installations: http://dev.mysql.com/doc/refman/5.1/en/mysql.html
To stop or start mysql database (you rarely should need doing that 'by hand'), use proper init script with stop
or start
parameter, usually /etc/init.d/mysql stop
. This, however depends on your linux distribution. Some new distributions encourage service mysql start
style.
You're logging in by using mysql
sql shell.
The error comes probably because double '-p' parameter. You can provide -ppassword
or just -p
and you'll be asked for password interactively. Also note, that some instalations might use mysql (not root) user as an administrative user. Check your sqlyog configuration to obtain working connection parameters.
I assume you are looking to use mysql client, which is a good thing and much more efficient to use than any phpMyAdmin alternatives.
The proper way to log in with the commandline client is by typing:
mysql -u username -p
Notice I did not type the password. Doing so would of made the password visible on screen, that is not good in multi-user environnment!
After typing this hit enter key, mysql will ask you for your password.
Once logged in, of course you will need:
use databaseName;
to do anything.
Good-luck.
To stop or start mysql on most linux systems the following should work:
/etc/init.d/mysqld stop
/etc/init.d/mysqld start
The other answers look good for accessing the mysql client from the command line.
Good luck!
if you're already logged in as root just
mysql -u root
prompting the password will otherwise return as error
use this "mysql -uroot -pPassword"
Try "sudo mysql -u root -p" please.