How to use phpmyadmin mysql database using terminal in ubuntu 10.4? - mysql

Can any one help me to use phpmyadmin mysql database through terminal.
I am using ubuntu 10.4.
I guess the command like this /opt/var/usr/ mysql. I'm not sure about it.

In terminal just type:
mysql -u username -p
and afterwards you'll be prompted for your password.
Normally MySQL is added to /bin/ so no need to explicitly give a path to it.

Answer:
The Below command used to access phpmyadmin mysql database though terminal
/opt/lampp/bin/mysql -uroot -ppassword

Related

How to get windows phpmyadmin databases (.SQL) backup from Ubuntu?

My windows10 is not starting up but I have installed Ubuntu along with windows.
I have some mysql databases in my windows environment which I need backup so is there any way to open windows version of the databases in ubuntu so I can export that databases.
after handling JoSSte above comment you need to run these command in terminal
mysql -u user_name -p this command will ask for password
after successfull above command , you can check your database using below command
show databases;
if your database is there you can export database using below command
mysqldump -u your_db_user_name -p [database_which_need_to_export] > database_name.sql
this command will give you sql file then you can import it using command or in phpmyadmin

Mysql ERROR : not connected

I am trying to connect to MySQL database from MySQL shell on windows.
No matter what I type in MySQL shell, it keeps giving me error : 'Not connected'.
Query eg 1 : mysql --host=localhost --port=3306 --user=root -p;
Query eg 2 : mysql -u root -p
O/P : ERROR: Not connected
I have MySQL server installed on my machine. Also MySQL service is running in the background.
Also, I was able to connect from MySQL workbench.
ERROR MESSAGE
MySQL Workbench Connection
My temporary workaround is that I make use of ssl protocol to connect to MySQL server :
MySQL> \connect root#localhost
MySQL localhost:33060+ ssl SQL > show databases;
The first step is that you need to check if you are in the MYSQL Shell SQL mode or JS mode.
Then if you are in SQL mode then you are good to go else you need to switch to SQL mode by this command
\sql
The next step is to connect using this command
\connect root#localhost
In your case, you might have given the privilege as the IP address so you need to check your localhost IP which can be done by this command in your command prompt.
ipconfig and then just check the IP address and put it in place of localhost in the previous command. If this still doesn't works then put 127.0.0.1:3306.
After this, it will prompt to add or save the password , enter a unique password there.
After this you are good to go and check the user and localhost after this by this command
SELECT user, host FROM mysql.user;
Try mysql -u root -p
I haven't used MySQL shell, I typically use gitbash and it works just fine
I had faced the same issue on my Windows 10 machine with MySQL 5.7 and the following commands helped me:
mysqlsh.exe - to open mysql shell; then
\sql - to start working with SQL;
finally:
\connect root#127.0.0.1:3306
You can use:
mysql -uroot -hlocalhost -P3306 -p
or
mysql -uroot -h127.0.0.1 -P3306 -p
or
mysql -uroot -p

Show databases command doesn't show my databases in MAMP in OS X

When I connect with /applications/mamp/library/bin/mysql -u root -p I enter perfectly to MySQL prompt, but the show databases command does not show any database. However, in phpMyadmin I see all my databases.
Does anyone know what I'm doing wrong?
Make sure you're connecting to the correct port.

How to change MySQL environment in vagrant server?

What are the correct steps to change the MySQL environment in vagrant?
Yes I found the correct steps to solve this.
Type these command in command prompt
vagrant up
vagrant ssh
mysql -u usernameOfMysql -p
enter the password.
Change to the database-> use databaseName
Copy the mysql code
show tables

Access mysql for MAMP from command line

I have been learning Ruby on Rails and have been using the command line successfully to view and edit the database (using the mysql command).
I am now using MAMP and trying to install Wordpress. It appears that it is using a "different" mysql. I.e., databases I create via the command line aren't viewable in MAMP's phpmyadmin, and vice versa.
How can I access MAMP's mysql via the command line? I'm guessing that I need to specify the host when logging in with the mysql command, but I'm not sure what to put there. Since phpmyadmin exists at localhost:8888/phpMyAdmin, I tried using mysql -h localhost:8888 -u root -p, but that didn't work (error: Unknown MySQL server host 'localhost:8888').
MAMP installs it's own MySQL which means that you now have two MySQL instances installed on you machine.
try typing this in your terminal
/Applications/MAMP/Library/bin/mysql
You can also add this to your a bash_profile so you don't have to write /Applications/MAMP/Library/bin/mysql each time by running in terminal :
sudo vi ~/.bash_profile
and adding
alias mysql="/Applications/MAMP/Library/bin/mysql"
Then, from terminal you can run : mysql -uroot -proot notice theres no space for this to work.