Installing xampp but phpmyadmin doesn't connect - mysql

So I installed xampp on my Linux machine running Ubuntu 14.04LTS. Now all of a sudden turns out when I try to connect to phpmyadmin it refuses to connect. I have already installed mysql separately as well but it doesn't seem to work. Any workaround for this?
The error that I get is :
MySQL said:
Cannot connect: invalid settings.
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
Any reason why this happens and solution to it?

Go to http://localhost/security/ and then click on the link http://localhost/security/xamppsecurity.php.
After that change password for superuser to 'root'.
After that open your http://localhost/phpmyadmin/

As per the comment by RiggsFolly I was running two instances of MySQL
So both mysql servers do end up messing with phpmyadmin and this is how you shutdown the external mysql server while using xampp's inbuilt mysql server to connect successfully using phpmyadmin:
Use whichmysql to find the utility that is running
Navigate to the directory where the external MySQL service is running:
$ cd /usr/bin
$ mysqladmin shutdown
This shuts down the MySQL service running if at all it is running.
$ sudo service mysql stop
This helps as well if at all it will tell you the status of the service if it is already shut down.
Now we need to stop the Xampp mysql server so we navigate to /lampp/bin and again execute the same command to shut mysql server down.
$ cd /opt/lampp/bin
$ mysqladmin shutdown
Simply restart xampp and you should be good to go.
$ sudo /opt/lampp/lampp restart

I just fell into the same error. The solution I used was, stopping all the servers of xampp, exiting the program. Starting and stoping mysql then starting xampp again
Initial procedure before starting xampp:
sudo service mysql stop
sudo /etc/init.d/apache2 stop
If it bring the error as stated in this question, then follow the procedure below.
That is:
sudo /opt/lampp/lampp stop
sudo service mysql start
sudo service mysql stop
sudo /opt/lampp/lampp start

Related

unable to stop mysql server on macos terminal after log on as root user

i am using a macos to run mysql on the terminal.
what i usually do is:
mysql.server start
mysql -u root -p
then mysql is okay to be used, for creating database, tables and etc.
but when i want to shut down mysql server. it will give me error message that my syntax is wrong.
mysql.server stop
May i ask if anyone has a similar issue before?
Thank You
I will terminate the terminal then type
mysql.server stop
and it will shut down successfully.
i am hoping i dont need to keep terminating my terminal before i can shut down mysql server.
mysql.server stop will only work from shell.
If you started the command line client mysql and you want to stop the server, either use the SQL command
SHUTDOWN
to shutdown your MySQL server (this requires shutdown privilege). Or execute system shell command with \!:
\! mysql.server stop.

Unable to access localhost/phpmyadmin

I've installed a LAMP stack, MySQL-server, apahe2, PHPMyAdmin, but unable to access is using localhost/PHPMyAdmin. I can access MySQL using the terminal. But not through PHPMyAdmin.
I also checked /var/www/html, no PHPMyAdmin folder is present.
I once deleted it by mistake, I think the issue is from there.
This is the output :
Try this In Terminal :
sudo /etc/init.d/apache2 stop
sudo /opt/lampp/lampp start
if it's not working try to change the port of phpmyadmin to 3306 to 3307
Hoping it will be useful

MySQL Error: Authentication plugin 'caching_sha2_password' cannot be loaded

I just installed MySQL Ver 14.14 Distrib 5.7.22 with Homebrew on my macOS v10.13.4.
I ran the command:
brew install mysql
After the installation completed, as directed by Homebrew, I ran the command:
mysql_secure_installation
and was returned the error: Error: Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/Cellar/mysql/5.7.22/lib/plugin/caching_sha2_password.so, 2): image not found
I tried a few things like changing default_authentication_plugin to mysql_native_password in the my.cnf file but it still throws the same error.
Next I tried running:
mysql_upgrade -u root
and I was thrown the same error again mysql_upgrade: Got error: 2059: Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/Cellar/mysql/5.7.22/lib/plugin/caching_sha2_password.so, 2): image not found while connecting to the MySQL server
Upgrade process encountered error and will not continue.
Any help is appreciated.
So, I found the running process of mysqld by sudo lsof -i tcp:3306 then I killed it using sudo kill -9 <PID>.
After this I tried mysql_secure_installation again, but ran into a new error :
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
After trying a few fixes for getting mysql.sock to work, I started the MySQL server with sudo mysql.server start then went ahead with mysql_secure_installation to set password for the root user.
This worked for me finally.
Note: Homebrew asks you to first do mysql_secure_installation before starting the MySQL server for the first time but that just made me run into endless loop of errors.
Restart the mysql server to take the changes in affect and try connecting via mysql with any mysql client.
Otherwise use docker
docker run -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d mysql --default-authentication-plugin=mysql_native_password
mysql -uroot --protocol tcp
Try in PWD
Related a question.
Authentication plugin 'caching_sha2_password' cannot be loaded
I figured out this should be an issue with the mysql version installed. Just as above you should first find then kill the mysqld process attached on port 3306
sudo lsof -i tcp:3306
sudo kill -9 <Peocess ID>
Then upgrade the mysql installation via brew, in this case:
brew upgrade mysql
This should solve it.Running mysql after the upgrade should start your server after the installation.
e.g mysql -u root -p [your password here]
I got this error in Sequel Pro trying to connect over SSH to an AWS Ubuntu server with MySQL installed locally.
I was using a non-root MySQL user and it gave me that error. It worked when I ran it with the root user and password.

MySQL error, missing sock, can still connect with everything except command line

I'm getting the following error when trying to connect to MySQL through the command line (Ubuntu 14.04)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Seems that the file /var/run/mysqld/mysqld.sock is missing. MySQL is still running
% sudo service mysql status
mysql start/running, process 42703
and I am able to connect with MySQLdb and sqlalchemy via Python and through MySQL Workbench and MySQL Pro. I was running a Python script and got the following error
(1053, 'Server shutdown in progress')
I restarted the script and everything ran like usual but since this point I have been unable to connect via command line. Not sure what happened or why the sock would disappear. I also ran
sudo find / -type s
and nothing related to MySQL is found.
UPDATE: Seems that someone uncommented bind-address = 127.0.0.1 (inside /etc/mysql/my.cnf), restarted the server, realized this was a mistake, put it back, and restarted. Would this remove the sock file?
Problem seems to be that multiple mysql processes are running. Try stopping mysql and mysqld processes followed by restarting mysql:
sudo pkill mysql
sudo pkill mysqld
sudo service mysql restart
now you should be able to log into mysql normally
mysql -u root -p
if it still doesn't work, and you're mysql database is local, try changing the bind-address from 127.0.0.1 to localhost before attempting to kill the processes like I showed you above.
Open up the configuration file:
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
look for the line containg bind-address and change the line to
bind-address = localhost
save the file and exit
now kill the processes and restart mysql ( first 3 steps in the beginning of this comment).

I can't start MySQL Server and Workbench error

I have just installed MySQL and MySQL Workbench.
After installing both, I can see the "MySQL" icon in System Preferences. But if I try to start MySQL Server it asks me the password, but then nothing happens.
So I tried to start MySQL Server from the terminal with the following command:
sudo /usr/local/mysql/support-files/mysql.server start
But it gave me this error:
Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/MBP.local.pid).
Can anyone help me please?
Before all this I've not had any problems starting and stopping MySQL, but I forgot the MySQL password so I had to uninstall MySQL and install it again because I needed to use Workbench. But obviously without the MySQL password it didn't work. Is there a way for me to recover the password?
Check if a mysql process already exists or not ps -ef | grep mysql
If yes, Kill the process kill -9 PID or killall -9 mysql mysqld
Check the owner ship of the mysql data directory is mysql:mysql
Then try to start mysql server sudo mysql.server start
If this do not resolve the issue. Then have a look in the mysql .err file
Check out: MySql ERROR! The server quit without updating PID file
The sudo line will try to run MySQL as root -- bad idea. Hopefully the mysql.server file was copied to /etc/init.d during install so all you should have to do is /etc/init.d/mysqld start