Reputation: 685
I have a database in phpmyadmin. How can I access database of phpmyadmin from ubuntu terminal?
Upvotes: 1
Views: 13911
Reputation: 4841
You can connect to a mysql server using the mysql
command
mysql --user=USERNAME -p --host=HOSTNAME --database=DATABASENAME
This will then prompt you for the password for the specified user (because the password switch was -p
instead of --password=PASSWORD
). Press return without typing anything for no password.
You can find more information on how to use the command by typing man mysql
or mysql --help
into your terminal.
Upvotes: 4
Reputation: 1068
mysql -u <username> -p<password> <database_name>
Make sure no space between -p and password. Of course, this password will be visible in history.
To overcome this:
1.Leave it blank and it will ask you for it.
2.start the command with a space in front of mysql
Upvotes: 0