Mini Servers: MySQL 4.1.22 Service: Difference between revisions

no edit summary
No edit summary
Line 1: Line 1:
=[http://ewefobyme.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
{{Uc nav mini servers}}
{{Uc nav mini servers}}
[[Image:Uc_mini_14.gif|MySQL 4.1.22|right]]'''Mini Server 12 MySQL 4.1.22-community-nt Core'''
[[Image:Uc_mini_14.gif|MySQL 4.1.22|right]]'''Mini Server 12 MySQL 4.1.22-community-nt Core'''
Line 42: Line 43:


'''Original:'''  
'''Original:'''  
{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"
{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"
|-style="background:#e8e8e8"
|-style="background:#e8e8e8"
!my.cnf located in folder: C:\mini_server_14\bin
!my.cnf located in folder: C:\mini_server_14\bin
|-style="background:#f5f5f5"
|-style="background:#f5f5f5"
|
|
<pre style="border:none;background:#f5f5f5;margin:0;padding:6">
&lt;pre style=&quot;border:none;background:#f5f5f5;margin:0;padding:6&quot;&gt;
# Uncomment the following rows if you move the MySQL distribution to another
# Uncomment the following rows if you move the MySQL distribution to another
# location
# location
basedir = "/"
basedir = &quot;/&quot;
datadir = "/data/"
datadir = &quot;/data/&quot;
tmpdir = "/tmp"
tmpdir = &quot;/tmp&quot;
</pre>
&lt;/pre&gt;
|}
|}
'''Change to:'''
'''Change to:'''
{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"
{|border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;
|-style="background:#e8e8e8"
|-style=&quot;background:#e8e8e8&quot;
!my.cnf located in folder: C:\mini_server_14\bin
!my.cnf located in folder: C:\mini_server_14\bin
|-style="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|
|
<pre style="border:none;background:#f5f5f5;margin:0;padding:6">
&lt;pre style=&quot;border:none;background:#f5f5f5;margin:0;padding:6&quot;&gt;
# Uncomment the following rows if you move the MySQL distribution to another
# Uncomment the following rows if you move the MySQL distribution to another
# location
# location
basedir = "c:/mini_server_14/"
basedir = &quot;c:/mini_server_14/&quot;
datadir = "c:/mini_server_14/data/"
datadir = &quot;c:/mini_server_14/data/&quot;
tmpdir = "c:/mini_server_14/tmp/"
tmpdir = &quot;c:/mini_server_14/tmp/&quot;
</pre>
&lt;/pre&gt;
|}
|}


Line 79: Line 80:
The second line starts the service notice it uses the unique name defined in the first line.  
The second line starts the service notice it uses the unique name defined in the first line.  


{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"
{|border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;
|-style="background:#e8e8e8"
|-style=&quot;background:#e8e8e8&quot;
!install.bat located in folder: C:\mini_server_14
!install.bat located in folder: C:\mini_server_14
|-style="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|
|
<pre style="border:none;padding:0;margin:0">
&lt;pre style=&quot;border:none;padding:0;margin:0&quot;&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
net start mini_server_14
net start mini_server_14
</pre>
&lt;/pre&gt;
|}
|}


Line 95: Line 96:
The uninstall batch file first stops the “MySQL” service and then proceeds to uninstall it. Note the use of the service name '''mini_server_14'''.
The uninstall batch file first stops the “MySQL” service and then proceeds to uninstall it. Note the use of the service name '''mini_server_14'''.


{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"
{|border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;
|-style="background:#e8e8e8"
|-style=&quot;background:#e8e8e8&quot;
!uninstall.bat located in folder: C:\mini_server_14
!uninstall.bat located in folder: C:\mini_server_14
|-style="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|
|
<pre style="border:none;padding:0;margin:0">
&lt;pre style=&quot;border:none;padding:0;margin:0&quot;&gt;
net stop mini_server_14
net stop mini_server_14
bin\mysqld-opt.exe --remove mini_server_14
bin\mysqld-opt.exe --remove mini_server_14
</pre>
&lt;/pre&gt;
|}
|}


Line 111: Line 112:
This batch file provides a convenient way to start a command window at the right location to run MySQL clients. It displays a quick start guide for reference.
This batch file provides a convenient way to start a command window at the right location to run MySQL clients. It displays a quick start guide for reference.


{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"
{|border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;
|-style="background:#e8e8e8"
|-style=&quot;background:#e8e8e8&quot;
!console.bat located in folder: C:\mini_server_14
!console.bat located in folder: C:\mini_server_14
|-style="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|
|
<pre style="border:none;padding:0;margin:0">
&lt;pre style=&quot;border:none;padding:0;margin:0&quot;&gt;
cd bin
cd bin
start cmd.exe /k type quick_start_guide.txt
start cmd.exe /k type quick_start_guide.txt
</pre>
&lt;/pre&gt;
|}
|}


Line 125: Line 126:


== Command Line ==
== Command Line ==
After installing the MySQL service with the above batch file you can start and stop the "MySQL" service at anytime using a command line this saves uninstalling the service every time you want to stop the server:
After installing the MySQL service with the above batch file you can start and stop the &quot;MySQL&quot; service at anytime using a command line this saves uninstalling the service every time you want to stop the server:


* '''net stop mini_server_14'''
* '''net stop mini_server_14'''
Line 138: Line 139:


=== Download ===
=== Download ===
Download this server from SourceForge [http://sourceforge.net/project/showfiles.php?group_id=53691&package_id=275691 Project Page] save the file '''mini_server_14.exe''' to drive '''C'''.
Download this server from SourceForge [http://sourceforge.net/project/showfiles.php?group_id=53691&amp;package_id=275691 Project Page] save the file '''mini_server_14.exe''' to drive '''C'''.


'''''Note'':''' Check out the mini server's [[Mini Servers: Support and download|support and download page]] detailing how to obtain full binaries for MySQL.
'''''Note'':''' Check out the mini server's [[Mini Servers: Support and download|support and download page]] detailing how to obtain full binaries for MySQL.
Line 168: Line 169:
# Install the server by double clicking on '''install.bat'''
# Install the server by double clicking on '''install.bat'''
# Run console.bat this opens a command window.
# Run console.bat this opens a command window.
# In the command window type the following:<br>'''mysqladmin --port=3314 --user=root --password=root status'''<br>If challenged by your firewall allow access for mysqladmin.exe
# In the command window type the following:&lt;br&gt;'''mysqladmin --port=3314 --user=root --password=root status'''&lt;br&gt;If challenged by your firewall allow access for mysqladmin.exe


Result similar to this confirms server is running:
Result similar to this confirms server is running:
<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysqladmin --port=3314 --user=root --password=root status
C:\mini_server_14\bin&gt;mysqladmin --port=3314 --user=root --password=root status
Uptime: 72  Threads: 1  Questions: 1  Slow queries: 0  Opens: 12
Uptime: 72  Threads: 1  Questions: 1  Slow queries: 0  Opens: 12
Flush tables: 1  Open tables: 3  Queries per second avg: 0.014
Flush tables: 1  Open tables: 3  Queries per second avg: 0.014


C:\mini_server_14\bin>
C:\mini_server_14\bin&gt;
</pre>
&lt;/pre&gt;


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 201: Line 202:


At the top of the file you will find there are two port lines these need changing locate this section:
At the top of the file you will find there are two port lines these need changing locate this section:
<pre>
&lt;pre&gt;
# This will be passed to all mysql clients
# This will be passed to all mysql clients
[client]
[client]
Line 216: Line 217:
port=3314
port=3314
#socket=MySQL
#socket=MySQL
</pre>
&lt;/pre&gt;
and change as shown:
and change as shown:


<pre>
&lt;pre&gt;
# This will be passed to all mysql clients
# This will be passed to all mysql clients
[client]
[client]
Line 234: Line 235:
port=3307
port=3307
#socket=MySQL
#socket=MySQL
</pre>
&lt;/pre&gt;


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 280: Line 281:
'''Server upgrade:''' If you upgrade the MySQL  server it's default is to have no password set, in this situation use the following to set a password:  
'''Server upgrade:''' If you upgrade the MySQL  server it's default is to have no password set, in this situation use the following to set a password:  


<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysqladmin --port=3314 --user=root password NEWPASSWORD
C:\mini_server_14\bin&gt;mysqladmin --port=3314 --user=root password NEWPASSWORD
</pre>
&lt;/pre&gt;


'''''Note'':''' ''password'' before NEWPASSWORD is a command.  
'''''Note'':''' ''password'' before NEWPASSWORD is a command.  
Line 288: Line 289:
'''Mini Server downloaded:''' Mini Server 4a has both user name and password set to root. To change an existing password use the following:
'''Mini Server downloaded:''' Mini Server 4a has both user name and password set to root. To change an existing password use the following:
   
   
<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysqladmin --port=3314 --user=root --password=root password NEWPASSWORD
C:\mini_server_14\bin&gt;mysqladmin --port=3314 --user=root --password=root password NEWPASSWORD
</pre>
&lt;/pre&gt;


For example to change the root password to fred123
For example to change the root password to fred123


<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysqladmin --port=3314 --user=root --password=root password fred123
C:\mini_server_14\bin&gt;mysqladmin --port=3314 --user=root --password=root password fred123
</pre>
&lt;/pre&gt;
To re-log in use the new password for example:
To re-log in use the new password for example:
<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysqladmin --port=3314 --user=root --password=fred123 status
C:\mini_server_14\bin&gt;mysqladmin --port=3314 --user=root --password=fred123 status
Uptime: 571  Threads: 1  Questions: 6  Slow queries: 0  Opens: 13  Flush tables: 1  Open tables: 4  Queries per second a
Uptime: 571  Threads: 1  Questions: 6  Slow queries: 0  Opens: 13  Flush tables: 1  Open tables: 4  Queries per second a
vg: 0.011
vg: 0.011
</pre>
&lt;/pre&gt;


==== Change password for other users ====
==== Change password for other users ====
To change a normal user's password you follow a similar process for example user mike, old password fred123 and new password power26:
To change a normal user's password you follow a similar process for example user mike, old password fred123 and new password power26:
<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysqladmin --port=3314 --user=mike --password=fred123 password power26
C:\mini_server_14\bin&gt;mysqladmin --port=3314 --user=mike --password=fred123 password power26
</pre>
&lt;/pre&gt;


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 323: Line 324:
'''Log into Mini Server 14'''
'''Log into Mini Server 14'''


To log into a mini server type the following: '''mysql --port=3314 --user=root --password=root''' on success a mysql prompt '''mysql>''' is displayed this is where you type in '''sql''' commands.
To log into a mini server type the following: '''mysql --port=3314 --user=root --password=root''' on success a mysql prompt '''mysql&gt;''' is displayed this is where you type in '''sql''' commands.


The following example logs into and then out of the server. At the mysql prompt I have typed '''quit''' this terminate the program logs out of the server.   
The following example logs into and then out of the server. At the mysql prompt I have typed '''quit''' this terminate the program logs out of the server.   


<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysql --port=3314 --user=root --password=root
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.22-community-nt
Your MySQL connection id is 2 to server version: 4.1.22-community-nt


Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> quit
mysql&gt; quit
Bye
Bye
C:\mini_server_14\bin>
C:\mini_server_14\bin&gt;
</pre>
&lt;/pre&gt;


'''Quick Example:'''
'''Quick Example:'''
Line 344: Line 345:
'''''Commands used'':'''
'''''Commands used'':'''


mysql --port=3314 --user=root --password=root<br>
mysql --port=3314 --user=root --password=root&lt;br&gt;
SELECT VERSION(), CURRENT_DATE;<br>
SELECT VERSION(), CURRENT_DATE;&lt;br&gt;
SHOW DATABASES;<br>
SHOW DATABASES;&lt;br&gt;
quit
quit


<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysql --port=3314 --user=root --password=root
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5 to server version: 4.1.22-community-nt
Your MySQL connection id is 5 to server version: 4.1.22-community-nt
Line 356: Line 357:
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


mysql> SELECT VERSION(), CURRENT_DATE;
mysql&gt; SELECT VERSION(), CURRENT_DATE;
+---------------------+--------------+
+---------------------+--------------+
| VERSION()          | CURRENT_DATE |
| VERSION()          | CURRENT_DATE |
Line 364: Line 365:
1 row in set (0.01 sec)
1 row in set (0.01 sec)


mysql> SHOW DATABASES;
mysql&gt; SHOW DATABASES;
+----------+
+----------+
| Database |
| Database |
Line 372: Line 373:
1 row in set (0.00 sec)
1 row in set (0.00 sec)


mysql> quit
mysql&gt; quit
Bye
Bye


C:\mini_server_14\bin>
C:\mini_server_14\bin&gt;
</pre>
&lt;/pre&gt;


After running the above you will have an idea what to expect. The next examples show only the commands used, I have included the prompts '''Z:\bin>''' (DOS prompt) and '''mysql>''' (mysql prompt) for reference do not type these in.
After running the above you will have an idea what to expect. The next examples show only the commands used, I have included the prompts '''Z:\bin&gt;''' (DOS prompt) and '''mysql&gt;''' (mysql prompt) for reference do not type these in.
    
    
'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 385: Line 386:


Use the following method to update or change password for user root
Use the following method to update or change password for user root
<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysql --port=3314 --user=root --password=root
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root
mysql> USE mysql;
mysql&gt; USE mysql;
mysql> update user set password=PASSWORD("NEWPASSWORD") where User='root';
mysql&gt; update user set password=PASSWORD(&quot;NEWPASSWORD&quot;) where User='root';
mysql> FLUSH PRIVILEGES;
mysql&gt; FLUSH PRIVILEGES;
mysql> quit
mysql&gt; quit
</pre>
&lt;/pre&gt;


For example change the root user password to fred123  
For example change the root user password to fred123  
<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysql --port=3314 --user=root --password=root
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root


mysql> USE mysql;
mysql&gt; USE mysql;
Database changed
Database changed
mysql> update user set password=PASSWORD("fred123") where User='root';
mysql&gt; update user set password=PASSWORD(&quot;fred123&quot;) where User='root';
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2  Changed: 0  Warnings: 0
Rows matched: 2  Changed: 0  Warnings: 0


mysql> FLUSH PRIVILEGES;
mysql&gt; FLUSH PRIVILEGES;
Query OK, 0 rows affected (1.03 sec)
Query OK, 0 rows affected (1.03 sec)


mysql> quit
mysql&gt; quit
Bye
Bye


--- Test new password ----------
--- Test new password ----------


C:\mini_server_14\bin>mysql --port=3314 --user=root --password=fred123
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=fred123
Welcome to the MySQL monitor.  Commands end with ; or \g.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Your MySQL connection id is 11
Line 418: Line 419:
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


mysql> quit
mysql&gt; quit
Bye
Bye
C:\mini_server_14\bin>
C:\mini_server_14\bin&gt;
</pre>
&lt;/pre&gt;


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 427: Line 428:
==== Change Root User name ====
==== Change Root User name ====
The root user does not need to be named 'root'. Most attackers will obviously try to compromise the 'root' user account and will be stopped if there is no 'root' user. To change the name of the root user account, use the following commands:
The root user does not need to be named 'root'. Most attackers will obviously try to compromise the 'root' user account and will be stopped if there is no 'root' user. To change the name of the root user account, use the following commands:
<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysql --port=3314 --user=root --password=root
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root
mysql> USE mysql;
mysql&gt; USE mysql;
mysql> UPDATE user SET user='mike' WHERE user='root';
mysql&gt; UPDATE user SET user='mike' WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql&gt; FLUSH PRIVILEGES;
mysql> quit
mysql&gt; quit
</pre>
&lt;/pre&gt;


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 440: Line 441:
In addition, the root account can be restricted to login from localhost with the following commands:
In addition, the root account can be restricted to login from localhost with the following commands:


<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysql --port=3314 --user=root --password=root
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root
mysql> use mysql;
mysql&gt; use mysql;
mysql> DELETE FROM user WHERE user = 'root' AND host = '%';
mysql&gt; DELETE FROM user WHERE user = 'root' AND host = '%';
mysql> FLUSH PRIVILEGES;
mysql&gt; FLUSH PRIVILEGES;
mysql> quit
mysql&gt; quit
</pre>
&lt;/pre&gt;


'''''Note'':''' Like Uniform Server 3.5-Apollo the mini server already restricts access to localhost only.   
'''''Note'':''' Like Uniform Server 3.5-Apollo the mini server already restricts access to localhost only.   
Line 456: Line 457:
'''''Note'':''' Shown as an example it does not exist on the mini server.
'''''Note'':''' Shown as an example it does not exist on the mini server.


<pre>
&lt;pre&gt;
C:\mini_server_14\bin>mysql --port=3314 --user=root --password=root
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root
mysql> use mysql;
mysql&gt; use mysql;
mysql> DELETE FROM user WHERE user = '';
mysql&gt; DELETE FROM user WHERE user = '';
mysql> FLUSH PRIVILEGES;
mysql&gt; FLUSH PRIVILEGES;
mysql> quit
mysql&gt; quit
</pre>
&lt;/pre&gt;


'''''Note'':''' The mini server does not include an anonymous account.
'''''Note'':''' The mini server does not include an anonymous account.
322

edits