System Preferences show MySQL is running. I can log into MySQL in Terminal logging is root.
I have set up a local host at "localhost/~jason/". Installed phpMyAdmin to "localhost/~jason/phpMyAdmin" which seems to work. But when I try to log in as root I get "Cannot log in to the MySQL server".
I am running OSX 10.10.3. MySQL 5.6.25. phpMyAdmin 4.4.9.
You have to check your config.inc.php and try to switch between localhost and 127.0.0.1 to connect to the MySQL server
have you tried WAMP? It`s much easier and simpler. Only takes a couple of minutes to set up and it has the newest PHP and MySQL versions.
Related
I'm trying to connect to mysql workbench but I get the following error
Error Message
Cannot Connect to Database Server
Your connection attempt failed for user 'root' from your host to server at
127.0.0.1:3306:
Could not open database.
Please:
1. Check that mysql is running on server 127.0.0.1
Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)
Check the root has rights to connect to 127.0.0.1 from your address (mysql rights define what clients can connect to the server and from which machines)
Make sure you are both providing a password if needed and using the correct
password for 127.0.0.1 connecting from the host address you're connecting
When I Test Connection, the parameters are correct, and actually I can enter and manage database in console.
When I installed Mysql for first time I could enter to Workbench one time and if I closed Workbench I had to restart my PC to connect another time.
I reinstalled 2 or 3 times Mysql server and Workbench and now I cannot connect from Workbench even once.
I faced similar issue and resolved it by following these steps:
In the terminal, execute this command
mysql -u root -p -h localhost -P 3306
Enter the password
This will be displayed
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 8.0.16 Homebrew
Now do,
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
Now you should be able to login and connect to DB in the workbench with password 'root'
I don't know if it helps anyone, but I had the same problem on windows after updating from MySQL 5.7 to 8.0.
The solution for me was to go to services.msc, stop the MySQL service and start the "MySQL80" service instead.
Then I restarted MySQL Workbench (run as admin) and it worked.
Please make sure that You have Downloaded MySQl server while dowloading MySQl workbench from MySQl installer (if you have checked Custom download)
I had the same issue a few days ago. As I could see in the original question, there has been multiple MySQL installation on the same computer - the same flow I tried after failing in the first attempt.
In the case we are trying to reinstall MySQL, we should be aware of remaining hidden files after MySQL has been uninstalled for the first time. In order to remove them all (and make one successful installation), we should:
Make hidden files visible on your computer (instructions)
Delete all files related to MySQL after choosing uninstalling of the MySQL (I had to check C://ProgramData hidden folder)
Try a new installation
I think that during the first installation, I didn't have all required dependencies on the computer (for example Python) and the installation failed. After installing it, uninstalling the MySQL, and taking steps from above, I finally managed to run it successfully :)
I hope this could help someone! :)
This solved it for me (MAC OS)
Open MySQL from System Preferences > MySQL
Click 'Stop MySQL Server' if the server is running
Select 'Initialize Database'
Type your new password.
Choose 'Use legacy password'
Start the Server again.
Now connect the MySQL Workbench
I've run into a problem here, and I'm not sure what to do. I migrated a Yosemite Mac to a new Mac Pro. Apache turns on, but MySql does not with this error: The operation couldn’t be completed. (XAMPPErrorDomain error 1.)
I didn't know if I need to reinstall MySql or upgrade it, or what this error means. I created the plist file as in the example and ran permissions, but that did not change the outcome. Going to websites in localhost, WordPress shows an error establishing db connection.
I went to Github to install MySql and it went fine, but it does not work with Xampp and Desktop Server. I chose to NOT start MySql when I rebooted, but apparently the Github version started anyway (and I cannot find a way to turn it off!) Now when I try to start MySql from Xampp, it says another version is already running.
Any help appreciated.
When I ask for version number in terminal I get this response:
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
HOWEVER, when I went to /var/ and temp I found an alias for mysql.sock, BUT it was not connected to an original file... Now that file does not exist anywhere on my computer.
Open /Applications/XAMPP/xamppfiles/xampp and add this line somewhere at the top:
unset DYLD_LIBRARY_PATH
I found that what was required was a complete uninstall of MySql following this procedure: http://bytearrays.com/completely-uninstall-mysql-mac-osx/
And then a reinstall. ServerPress.com was very helpful in diagnosing the problems.
I just upgraded my comp to the beta Yosemite and now my MySQL is giving me a connection problem.
I used to be able to run this command in terminal and get results:
/usr/local/mysql/bin/mysql -uroot -e "SELECT * FROM table_name"
But now it returns this:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I'm not sure how I even set this connection up in the first place so please any answers, pretend I'm not too savvy with this... Thanks in advance!!
First, verify that your MySQL server is running:
mysql.server start
If that was not the issue, try starting the MySQL server in safe-mode using these instructions
Okay I found out what happened. When I upgraded to Yosemite, this file disappeared or something. Anyway I had to reinstall the files. Everything is here in this link under the MySQL section:
http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/
I have my websites on a VPS - CentOS. Suddenly all of them stopped working and are showing database connection error.
I have tried restarting mysql with the following command in SSH /etc/rc.d/init.d/mysqld restart but when it tries to stop it it says "Failed".
Any idea on what could I do?
Please check you mysql log file (/var/log/mysqld.log).
I download mysql installer here:
http://dev.mysql.com/downloads/installer/
And then I downloaded MySql WorkBench.
At workbench's connection configuration I put hostname as "127.0.0.1", port "3306", user: "root", password is empty. I click "test connection" and it gives me this error:
"Can't connect to MySQL server on '127.0.0.1' (10061)"
What am I missing?
See here for starting the service and here for how to make it permanent.
In short to test it, open a "DOS" terminal with administrator privileges and write:
shell> "C:\Program Files\MySQL\[YOUR MYSQL VERSION PATH]\bin\mysqld"
Consider using the MySQL Installer for Windows as it installs and updates the various MySQL products on your system, including MySQL Server, MySQL Workbench, and MySQL Notifier. The Notifier monitors your MySQL instances so you'll know if MySQL is running, and it can also be used to start/stop MySQL.
removing temp files, and did you restart the computer or stop the MySQL service? That's the error message you get when there isn't a MySQL server running.