Saturday, April 20, 2024
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 115582  / 1 Year ago, wed, november 2, 2022, 1:18:38

accessing phpmyadmin db from terminal now in ubuntu 13.04 i firstly installed mysql server with
sudo apt-get install mysql-server mysql server version 5.5 now in terminal i can check if it is working by



sudo netstat -tap | grep mysql


it responds me by prompting me for password and then



tcp        0      0 localhost:mysql         *:*                     LISTEN             26214/mysqld


but to connect using my root account i typed mysql -u root -p prompting for password it shows
ERROR 1045 (28000): Access denied for user 'username'@'localhost' (using password: YES)



when i try this /opt/lampp/bin/mysql -u root -p it ask for password and says
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)



what is there in /etc/mysql/my.cnf
and what is in /opt/lampp/bin/mysql



any solution?


More From » command-line

 Answers
0

Have you tried setting up password for root soon after installing MySQL?? If not first try to Enter the command in a terminal below;



mysql -u root


Now it should open the mysql console. And type the following line:



SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');


To exit from the mysql console enter exit.



Then try reconnecting with following line;



mysql -u root -p


Try the password you've entered.



Source: How to connect and create a database in MySQL?


[#27365] Thursday, November 3, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
enefiama

Total Points: 43
Total Questions: 125
Total Answers: 102

Location: Gabon
Member since Sat, Jul 25, 2020
4 Years ago
;