Mini Servers: MySQL problems: Difference between revisions
Mini Servers: MySQL problems (view source)
Revision as of 07:54, 24 November 2010
, 24 November 2010Reverted edits by Upazixorys (Talk); changed back to last version by Ric
Upazixorys (talk | contribs) No edit summary |
m (Reverted edits by Upazixorys (Talk); changed back to last version by Ric) |
||
Line 1: | Line 1: | ||
{{Uc nav mini servers}} | {{Uc nav mini servers}} | ||
'''MySQL problems''' | '''MySQL problems''' | ||
Line 13: | Line 12: | ||
'''No other servers running:''' | '''No other servers running:''' | ||
<pre> | |||
L:\bin | L:\bin>mysqladmin --user=root --password=root status | ||
mysqladmin: connect to server at 'localhost' failed | mysqladmin: connect to server at 'localhost' failed | ||
error: 'Can't connect to MySQL server on 'localhost' (10061)' | error: 'Can't connect to MySQL server on 'localhost' (10061)' | ||
Check that mysqld is running on localhost and that the port is 3306. | Check that mysqld is running on localhost and that the port is 3306. | ||
You can check this by doing 'telnet localhost 3306' | You can check this by doing 'telnet localhost 3306' | ||
</pre> | |||
You can force a port as follows: | You can force a port as follows: | ||
<pre> | |||
L:\bin | L:\bin>mysqladmin --port=3313 --user=root --password=root status | ||
Uptime: 816 Threads: 1 Questions: 2 Slow queries: 0 Opens: 11 Flush tables: 1 Open tables: 2 Queries per second a | Uptime: 816 Threads: 1 Questions: 2 Slow queries: 0 Opens: 11 Flush tables: 1 Open tables: 2 Queries per second a | ||
vg: 0.002 | vg: 0.002 | ||
</pre> | |||
This clearly works like I said there is no configuration file on the search paths: | This clearly works like I said there is no configuration file on the search paths: | ||
<pre> | |||
Default options are read from the following files in the given order: | Default options are read from the following files in the given order: | ||
C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf | C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf | ||
</pre> | |||
Interestingly it does not look in the folder from where the client is run (normally the default with most programs) | Interestingly it does not look in the folder from where the client is run (normally the default with most programs) | ||
Line 40: | Line 39: | ||
You can force a client to read a default file as follows: | You can force a client to read a default file as follows: | ||
<pre> | |||
--defaults-file=my.cnf (this file is contained in the folder with the execuitable folder bin) | --defaults-file=my.cnf (this file is contained in the folder with the execuitable folder bin) | ||
</pre> | |||
Hence this will give: | Hence this will give: | ||
<pre> | |||
L:\bin | L:\bin>mysqladmin --defaults-file=my.cnf --user=root --password=root status | ||
Uptime: 1628 Threads: 1 Questions: 3 Slow queries: 0 Opens: 11 Flush tables: 1 Open tables: 2 Queries per second | Uptime: 1628 Threads: 1 Questions: 3 Slow queries: 0 Opens: 11 Flush tables: 1 Open tables: 2 Queries per second | ||
avg: 0.002 | avg: 0.002 | ||
L:\bin | L:\bin> | ||
</pre> | |||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
Line 59: | Line 58: | ||
Open mysql_start.bat this line forces the server to use the correct configuration file: | Open mysql_start.bat this line forces the server to use the correct configuration file: | ||
<pre> | |||
start \bin\mysqld-opt.exe --defaults-file=/bin/my.cnf | start \bin\mysqld-opt.exe --defaults-file=/bin/my.cnf | ||
</pre> | |||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
Line 67: | Line 66: | ||
Running server as a service (mini server 14) identical paths are searched again the configuration file will not be found. The server needs to be forced to read the configuration file however there is a little twist to this: | Running server as a service (mini server 14) identical paths are searched again the configuration file will not be found. The server needs to be forced to read the configuration file however there is a little twist to this: | ||
<pre> | |||
The following options may be given as the first argument: | The following options may be given as the first argument: | ||
--defaults-file=# Only read default options from the given file # | --defaults-file=# Only read default options from the given file # | ||
</pre> | |||
From the above this would be a logical (Install.bat): | From the above this would be a logical (Install.bat): | ||
<pre> | |||
C:\mini_server_14\bin\mysqld-opt.exe --defaults-file=C:/mini_server_14/bin/my.cnf --install mini_server_14 | C:\mini_server_14\bin\mysqld-opt.exe --defaults-file=C:/mini_server_14/bin/my.cnf --install mini_server_14 | ||
</pre> | |||
However it produces this error: | However it produces this error: | ||
<pre> | |||
Installing MySQL Service ... | Installing MySQL Service ... | ||
The filename, directory name, or volume label syntax is incorrect. | The filename, directory name, or volume label syntax is incorrect. | ||
Line 87: | Line 86: | ||
More help is available by typing NET HELPMSG 2185. | More help is available by typing NET HELPMSG 2185. | ||
Press any key to continue . . . | Press any key to continue . . . | ||
</pre> | |||
Well that was a real pain I know the install option works on its own so perhaps it’s the order of commands. I tried the following with success: | Well that was a real pain I know the install option works on its own so perhaps it’s the order of commands. I tried the following with success: | ||
<pre> | |||
C:\mini_server_14\bin\mysqld-opt.exe --install mini_server_14 --defaults-file=C:/mini_server_14/bin/my.cnf | C:\mini_server_14\bin\mysqld-opt.exe --install mini_server_14 --defaults-file=C:/mini_server_14/bin/my.cnf | ||
</pre> | |||
==== Clients ==== | ==== Clients ==== | ||
Line 109: | Line 108: | ||
== Mini Server 12 MySQL 5.0.51b Service == | == Mini Server 12 MySQL 5.0.51b Service == | ||
To obtain information about the server type the following at a command prompt: | To obtain information about the server type the following at a command prompt: | ||
<pre> | |||
mysqld-opt --verbose --help | mysqld-opt --verbose --help > info.txt | ||
</pre> | |||
This creates a file where you can read the details at your own leisure. Of importance is this line: | This creates a file where you can read the details at your own leisure. Of importance is this line: | ||
<pre> | |||
Default options are read from the following files in the given order: | Default options are read from the following files in the given order: | ||
C:\my.ini C:\my.cnf C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\mini_server_12\my.ini C:\mini_server_12\my.cnf | C:\my.ini C:\my.cnf C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\mini_server_12\my.ini C:\mini_server_12\my.cnf | ||
</pre> | |||
Both clients also produce a similar result (mysqladmin --help and mysql --help) for the search path. Placing the configuration file in folder C:\mini_server_12 allows it to be picked up by the three application. | Both clients also produce a similar result (mysqladmin --help and mysql --help) for the search path. Placing the configuration file in folder C:\mini_server_12 allows it to be picked up by the three application. |