#2002 Cannot log in to the MySQL server error - mysql

I cannot log in to my mySQL database server anymore.
I am currently using WAMP 2.2 on Windows 8.1 64 bits.
I tried reinstalling WAMP server but the problem still persists.
I have also edited the config.inc.php file and changed the host name from 'localhost' to '127.0.0.1'; however the problem still exists.

I found the problem, eventually. It had nothing to do with any of the configuration files though.
My ESET Smart Security antivirus updated silently and blocked the mysql application. I did not even get a notification for it!
I figured it out when I tried logging in to phpMyadmin after turning off my antivirus.
I had to allow communication for mysqld.exe in the antivirus settings.

Using the Wampmanager menus take a look at the mysql error log.
left click wampmanager -> MySQL -> MySQL log
If that does not show any [error] messages then also have a look at the 'Windows Event Viewer' in the 'Application' section for messages from MySQL.
The normal problem is a rogue 'my.ini' or 'my.cnf' file on your system. Search for these 2 files in the C;\windows folder, if you find any then delete them.
DO NOT DELETE THE my.ini FILE FREOM ANYWHERE IN THE C;\WAMP folder structure.

Recently I encountered a problem with MySQL, It was showing an error “Error : 1067 the process terminated unexpectedly” when I tried to start the service in services.msc
So I googled it but didn’t found the perfect solution. I will show how can you debug the issue. First look for file my.ini which can be found in “C:\wamp\bin\mysql\mysql5.6.17″ , open that file on look for “log-error”, this will show you the path where error log is stored. In my case it is, “c:/wamp/logs/mysql.log”.
Open the log file and look for last error you got, you should be today’s date when you tried to start the wampmysqld from services. At this stage, you will get error and understand what it say. In my case it is,
enter image description here
The folders for all databases are in “C:\wamp\bin\mysql\mysql5.6.17\data”. To fix I moved kmk folder to some other place. After this, wampmysqld in services.msc is getting started without any error.

Related

There is no my.ini file in mysql5.6 installed folder

How to add that file. For this reason I can't run the mysql. There is a error called
"ERROR 2013 (HY000): Lost connection to MySQL server during query".
I had a similar problem once.
What my colleague did was, he copied the same file from his machine to mine and it worked !
P.S: I know its not a proper solution, but see if it works and saves some time for u
I heard In windows my.ini sometimes name as my.cnf
but find the my.ini/my.cnf file on your windows PC follow below steps.
goto services,find entry like 'MySQL55', right click on it ,select properties,you can see like "C:/Program Files/MySQL/MySQL Server 5.5/bin\mysqld" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.5\my.ini" MySQL55

Unable to connect to your database server using the provided settings

I am usign codeigniter and I have hosted my web site on free hosting and everything was fine until an error occurred. The error is
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 346
But if I refresh the page the error is gone, but sometimes comes again and I don't why.
I have checked the forum for other errors like this and I have found that first I need to debug to understand what the error is.
It shows
Connecting to database: database_name
Connected OK:file: /home/vol11_6/byethost7.com/database_name/htdocs/application/config/database.php Line: 81
Other users say that the error comes from php.ini or mysql.default_socket was pointing to file in a non-existent directory.
My question is how am I supposed to find this php.ini or the directory like /var/lib/mysql/mysql.sock
on the free hosting. I can't find none of them.
Sorry if something was unclear.
Thank you in advance.

Xampp Linux: PDOException: SQLSTATE[HY000] [2002] Connection refused in lock_may_be_available() error

I have been struggling to find a solution for this issue with MySQL. Things changed after I placed a ojdbc jar file on Apache Solr tomcat server. Since then i have been getting this error. It seems there is yet another mysql instance running on the machine.
Xampp Status shows MySQL Database is deactivated. I have been searching for a working solution since this morning but no luck. Your help is very much appreciated.
PS: /opt/lampp/lampp status says mysql is 'running'. When stopped, it reads 'OK' but when starting it again, it says 'already running'....and the Xampp Status page says MySQL database is Deactivated
The command /opt/lampp/lampp status basically goes and check for the pid file
MYSQL_PIDFILE=/opt/lampp/var/mysql/$HOSTNAME.pid
Sometimes this PID file get corrupted (in case of a crash, or procees kill).
In such scenario, the status command will tell you that the mysql is running, where as there is no process that exists for that PID file and the XAMPP status which shows in the browser will not be able to connect to the server (because it is not running) and hence come as deactivated.
Just rename the pid file as $HOSTNAME_bkp.pid or something like that and restart lampp, the issue will get resolved.

XAMPP/LAMPP "Connection for controluser as defined in your configuration failed"

I see the others who answered this, but the answer says to log in as root and create a new user and database. I can't even get that far. I just installed a brand new XAMPP instance, start it and when I go to localhost/phpmyadmin, I get the error message in the subject line.
I also have:
2002 No such file or directory
The server is not responding (or the local server's socket is not correctly configured)
I checked that as well and I see the socket info in the config is left blank and the comment above it says that it will just use the mysql defaults.
When I go to the status page for XAMPP, it says that the MySQL database is activated. I just can't connect to phpmyadmin.
I literally did nothing else from install to startup to trying to get to phpmyadmin.
I solved this same problem by empting cookies/cache of firefox.

system error 1067 has occurred

Ran into some troubles with XAMPP after MySQL wasn't starting. So, I typed in the command prompt: 'net start MySQL', and it gave me this error message listed in the subject line.
Anyone know how to alleviate this? Thanks for your help!
This did the trick for me:
https://serverfault.com/questions/214435/error-1067-the-process-terminated-unexpectedly-when-trying-to-install-mysql-on/214846#214846
Of course, in this case, you have to completely clean up the xampp folder, which doesn't always happen. I guess I backed up the necessary files first (data folder from mysql folder and the htdocs folder). Uninstall XAMPP. Check the xampp folder for any content that remains and delete everything. You may want to reboot afterwards, just in case. Then reinstall XAMPP. Copy the backed-up folders back to their respective places, and hopefully, mySql will work again in XAMPP.
In my case it was enough to give full (absolute) paths to the xampp/mysql/bin/my.ini file. For example I changed basedir from "/xampp/mysql/" to: "E:/xampp/mysql/", and so on.
This or this might help you, if you're on windows
According to the posts, uninstalling then reinstalling with the --defaults-file option would fix the problem. Make sure to have the Services manager window closed, as this can cause weird bugs while trying to fix the problem
You can re-register your mysqld as a service and have it point to the my.cnf file with the proper data directory set: See http://www.jerrytravis.com/?p=533 for directions on how to do so. The article in the link refers to doing it when you've moved a Zend Server folder, however, the procedure will work for any msyql installation. Just cd to the proper directories.
I encountered exactly the same problem. Here is the solution that work for my situation.
In my case I already installed xamp with mysql listening to port 3306, also I have mysql 5.0 listening to port 3307.
Then I am trying to install 64 bit mysql version 5.6 listening to port 3308, I already define it in my.ini, and then start cmd (must be open by run as administrator). My installation was "d:\mysql64", then go to that folder in cmd dialog box, then type "bin\mysqld --install mysql64 --default-file=d:\mysql64\my.ini". It was said that service installed successfully but when I try to start it by "net start mysql64", it give that error 1067.I also already try to install and reinstall several times by modifying my.ini but the problem persist.
The solution is =
remove the service by "bin\mysqld --remove mysql64"
reinstall the service by "bin\mysqld --install mysql64 --port=3308" ----> this is the solution
try to start mysql64 by window services or by "net start mysql64"
It will started successfully.
So in this case seems that --default-file argument was ignored by window service manager, because
I already define the port in my.ini but the service can not start and giving 1067 error
I had the same problem, but on windows. What I've found is that the service was created under an unpriviledged account (in my case nt_authority). When I changed this to the "system" account, everything worked.
I think that at least a warning should be added to the product when the user tries to install MySQL on a path that contains whitespaces. This was the reason for the error "System error 1067 has occurred", which vanished after reinstalling MySQL under a path without blanks (used C:\Programs instead of C:\Program Files, which unfortunately appears in German Windows 10 as C:\Programme, i.e. w/o any spaces!).