Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

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?

share|improve this answer
    
but when i again try to connect by mysql -u root -p its showing `ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) –  black Jan 21 at 15:26
    
this error came after try the above steps?? –  AzkerM Jan 21 at 17:26
    
yes. could not open phpmyadmin from localhost xampp. –  black Jan 21 at 21:34
add comment

yes man.after i followed those steps i was able to connect to phpmyadmin from terminal but after a restart i see i cant access phpmyadmin from localhost

#2002 - No such file or directory The server is not responding (or the local server's socket is not correctly configured) and also status from localhost shwing mysql database deactivated . all other like SSI,PHP,CGI is activated. in security section its howing phpmyadmin as unknown and mysql user root no password unknown.

before it was all activated and secured i have done that to set password for root and localhost with all preveiledged when i installed xampp in linux. my config.inc.php file.location /opt/lampp/phpmyadmin

$cfg['blowfish_secret'] = '$5hfhjfhgst5fg4%43(*&'; /* YOU SHOULD CHANGE THIS FOR A     MORE SECURE COOKIE AUTH! */


/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'wtf11111';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
//$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

In my.cnf located in /etc/mysql/my.cnf

client]
port        = 3306
socket      = /var/run/mysqld/mysqld.sock

[mysqld_safe] socket = /var/run/mysqld/mysqld.sock nice = 0

[mysqld] # # * Basic Settings # user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp lc-messages-dir = /usr/share/mysql skip-external-locking

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.