"MySQL won't let me log in and I'm sure I have my password right"
"I've just installed MySQL and I'm using it the first time - but it seems to have a lot of data about your books already loaded"
"I'm running MySQL version x, but it claims to be version y"
Occasional incidents of MySQL courses. A possible cause? With every trainee running a MySQL daemon on their computer so that they can practise administration tasks, someone may be connecting to the wrong server. Remember that MySQL provides its service through TCP/IP port 3306 (default) and so it can be just as easy to talk to a server on another machine as the server on yours. How is the decision made?
1. Within the code of MySQL clients, defaults are defined which are used if there's no other indication given
2. A file called /etc/my.cnf is checked for any changes from the default
(On Windows systems - my.ini in the Windows system directory)
3. A file called .my.cnf in the user's home directory is checked for any changes from default
(On Windows systems - my.cnf in the root directory)
4. Command line options can override settings
In the
sourcing and Installing MySQL module of our notes, we say:
If Mysql has been pointed to elsewhere you may need to
mv /etc/my.cnf /etc/mycnf.old
mv ~/.my.cnf ~/mycnf.old
and on a new installation this will revert your MySQL clients back to defaults unless you use command line overrides.
(written 2005-01-29, updated 2006-06-05)
Associated topics are indexed under
S161 - Data Access and Security in MySQL [3270] SQL - Data v Metadata, and the various stages of data selection - (2011-04-29)
[2647] Removing duplicates from a MySQL table - (2010-02-22)
[2263] Mysqldump fails as a cron job - a work around - (2009-06-30)
[2204] Images in a database? How big is a database? (MySQL) - (2009-05-28)
[1131] MySQL - Password security (authentication protocol) - (2007-04-02)
[947] What is an SQL injection attack? - (2006-11-27)
[647] Checking for MySQL errors - (2006-03-15)
[535] MySQL permissions and privileges - (2005-12-20)
[401] What is an SQL injection attack? - (2005-08-02)
[192] Current MySQL and PHP paths and upgrades - (2005-01-28)
Some other Articles
Allow for peak traffic on your web siteAn Open Source course on the Channel IslandsCustomer service - examples to warn usPublished PhotographerThe wrong MySQLSetting up a training room for a coursePython enginesTuesdays and FridaysPink elephant and appreciation