Mini Servers: MySQL problems: Difference between revisions

no edit summary
(New page: {{Uc nav mini servers}} '''MySQL problems''' While designing the MySQL mini server series I found a number of inconsistencies. Running two version 4’s and two version 5’s sometimes th...)
 
No edit summary
Line 1: Line 1:
=[http://ujybyqum.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
{{Uc nav mini servers}}
{{Uc nav mini servers}}
'''MySQL problems'''
'''MySQL problems'''
Line 12: Line 13:


'''No other servers running:'''
'''No other servers running:'''
<pre>
&lt;pre&gt;
L:\bin>mysqladmin --user=root --password=root status
L:\bin&gt;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>
&lt;/pre&gt;


You can force a port as follows:
You can force a port as follows:


<pre>
&lt;pre&gt;
L:\bin>mysqladmin --port=3313 --user=root --password=root status
L:\bin&gt;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>
&lt;/pre&gt;


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>
&lt;pre&gt;
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>
&lt;/pre&gt;


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 39: Line 40:
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>
&lt;pre&gt;
--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>
&lt;/pre&gt;


Hence this will give:
Hence this will give:
<pre>
&lt;pre&gt;
L:\bin>mysqladmin --defaults-file=my.cnf --user=root --password=root status
L:\bin&gt;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&gt;
</pre>
&lt;/pre&gt;


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 58: Line 59:
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>
&lt;pre&gt;
start \bin\mysqld-opt.exe --defaults-file=/bin/my.cnf
start \bin\mysqld-opt.exe --defaults-file=/bin/my.cnf
</pre>
&lt;/pre&gt;


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 66: Line 67:
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>
&lt;pre&gt;
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>
&lt;/pre&gt;


From the above this would be a logical (Install.bat):
From the above this would be a logical (Install.bat):


<pre>
&lt;pre&gt;
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>
&lt;/pre&gt;


However it produces this error:
However it produces this error:


<pre>
&lt;pre&gt;
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 86: Line 87:
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>
&lt;/pre&gt;


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>
&lt;pre&gt;
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>
&lt;/pre&gt;


==== Clients ====
==== Clients ====
Line 108: Line 109:
== 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>
&lt;pre&gt;
mysqld-opt --verbose --help > info.txt
mysqld-opt --verbose --help &gt; info.txt
</pre>
&lt;/pre&gt;


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>
&lt;pre&gt;
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>
&lt;/pre&gt;


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.
322

edits