Page 1 of 1

logging into mysql using the command line

Posted: Wed Sep 04, 2002 10:35 am
by noguru
Hi

Up to now I've used a webinterface which someone wrote before me, to work on my database, but now there is a problem with this interface and I need to get into my database using an alternative way, such as the SSH command line.

Can anyone tell me how to login to mysql using the command line? I know it should be something like "mysql -parameters such as hostname, database, username and password" , but nothing seems to work.

Thank you

Posted: Wed Sep 04, 2002 11:37 am
by Tzicha
To login to a remote host:
mysql -h <host> -u <user> -p

Not supplying the password after the -p flag will prompt you to type it, that way it doesn't appear in ps ax listings. If MySQL is running on the localhost:
mysql -u <user> -p

Posted: Wed Sep 04, 2002 12:45 pm
by noguru
thnx tzicha!