Mini Servers: MySQL 4.1.22 Service: Difference between revisions
Mini Servers: MySQL 4.1.22 Service (view source)
Revision as of 10:23, 24 November 2010
, 24 November 2010no edit summary
m (→Download) |
Upazixorys (talk | contribs) 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= | {|border="0" cellpadding="4" cellspacing="1" style="background:#222222" | ||
|-style= | |-style="background:#e8e8e8" | ||
!my.cnf located in folder: C:\mini_server_14\bin | !my.cnf located in folder: C:\mini_server_14\bin | ||
|-style= | |-style="background:#f5f5f5" | ||
| | | | ||
<pre style="border:none;background:#f5f5f5;margin:0;padding:6"> | |||
# 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 = "/" | ||
datadir = | datadir = "/data/" | ||
tmpdir = | tmpdir = "/tmp" | ||
</pre> | |||
|} | |} | ||
'''Change to:''' | '''Change to:''' | ||
{|border= | {|border="0" cellpadding="4" cellspacing="1" style="background:#222222" | ||
|-style= | |-style="background:#e8e8e8" | ||
!my.cnf located in folder: C:\mini_server_14\bin | !my.cnf located in folder: C:\mini_server_14\bin | ||
|-style= | |-style="background:#f5f5f5" | ||
| | | | ||
<pre style="border:none;background:#f5f5f5;margin:0;padding:6"> | |||
# 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 = "c:/mini_server_14/" | ||
datadir = | datadir = "c:/mini_server_14/data/" | ||
tmpdir = | tmpdir = "c:/mini_server_14/tmp/" | ||
</pre> | |||
|} | |} | ||
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= | {|border="0" cellpadding="4" cellspacing="1" style="background:#222222" | ||
|-style= | |-style="background:#e8e8e8" | ||
!install.bat located in folder: C:\mini_server_14 | !install.bat located in folder: C:\mini_server_14 | ||
|-style= | |-style="background:#f5f5f5" | ||
| | | | ||
<pre style="border:none;padding:0;margin:0"> | |||
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> | |||
|} | |} | ||
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= | {|border="0" cellpadding="4" cellspacing="1" style="background:#222222" | ||
|-style= | |-style="background:#e8e8e8" | ||
!uninstall.bat located in folder: C:\mini_server_14 | !uninstall.bat located in folder: C:\mini_server_14 | ||
|-style= | |-style="background:#f5f5f5" | ||
| | | | ||
<pre style="border:none;padding:0;margin:0"> | |||
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> | |||
|} | |} | ||
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= | {|border="0" cellpadding="4" cellspacing="1" style="background:#222222" | ||
|-style= | |-style="background:#e8e8e8" | ||
!console.bat located in folder: C:\mini_server_14 | !console.bat located in folder: C:\mini_server_14 | ||
|-style= | |-style="background:#f5f5f5" | ||
| | | | ||
<pre style="border:none;padding:0;margin:0"> | |||
cd bin | cd bin | ||
start cmd.exe /k type quick_start_guide.txt | start cmd.exe /k type quick_start_guide.txt | ||
</pre> | |||
|} | |} | ||
Line 125: | Line 126: | ||
== Command Line == | == Command Line == | ||
After installing the MySQL service with the above batch file you can start and stop the | 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: | ||
* '''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&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: | # 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 | ||
Result similar to this confirms server is running: | Result similar to this confirms server is running: | ||
<pre> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>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> | ||
</pre> | |||
'''''[[#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> | |||
# 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> | |||
and change as shown: | and change as shown: | ||
<pre> | |||
# 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> | |||
'''''[[#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> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>mysqladmin --port=3314 --user=root password NEWPASSWORD | ||
</pre> | |||
'''''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> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>mysqladmin --port=3314 --user=root --password=root password NEWPASSWORD | ||
</pre> | |||
For example to change the root password to fred123 | For example to change the root password to fred123 | ||
<pre> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>mysqladmin --port=3314 --user=root --password=root password fred123 | ||
</pre> | |||
To re-log in use the new password for example: | To re-log in use the new password for example: | ||
<pre> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>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> | |||
==== 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> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>mysqladmin --port=3314 --user=mike --password=fred123 password power26 | ||
</pre> | |||
'''''[[#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 | 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. | ||
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> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>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 | mysql> quit | ||
Bye | Bye | ||
C:\mini_server_14\bin | C:\mini_server_14\bin> | ||
</pre> | |||
'''Quick Example:''' | '''Quick Example:''' | ||
Line 344: | Line 345: | ||
'''''Commands used'':''' | '''''Commands used'':''' | ||
mysql --port=3314 --user=root --password=root | mysql --port=3314 --user=root --password=root<br> | ||
SELECT VERSION(), CURRENT_DATE; | SELECT VERSION(), CURRENT_DATE;<br> | ||
SHOW DATABASES; | SHOW DATABASES;<br> | ||
quit | quit | ||
<pre> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>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 | mysql> 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 | mysql> SHOW DATABASES; | ||
+----------+ | +----------+ | ||
| Database | | | Database | | ||
Line 372: | Line 373: | ||
1 row in set (0.00 sec) | 1 row in set (0.00 sec) | ||
mysql | mysql> quit | ||
Bye | Bye | ||
C:\mini_server_14\bin | C:\mini_server_14\bin> | ||
</pre> | |||
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 | 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. | ||
'''''[[#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> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>mysql --port=3314 --user=root --password=root | ||
mysql | mysql> USE mysql; | ||
mysql | mysql> update user set password=PASSWORD("NEWPASSWORD") where User='root'; | ||
mysql | mysql> FLUSH PRIVILEGES; | ||
mysql | mysql> quit | ||
</pre> | |||
For example change the root user password to fred123 | For example change the root user password to fred123 | ||
<pre> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>mysql --port=3314 --user=root --password=root | ||
mysql | mysql> USE mysql; | ||
Database changed | Database changed | ||
mysql | mysql> update user set password=PASSWORD("fred123") 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 | mysql> FLUSH PRIVILEGES; | ||
Query OK, 0 rows affected (1.03 sec) | Query OK, 0 rows affected (1.03 sec) | ||
mysql | mysql> quit | ||
Bye | Bye | ||
--- Test new password ---------- | --- Test new password ---------- | ||
C:\mini_server_14\bin | C:\mini_server_14\bin>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 | mysql> quit | ||
Bye | Bye | ||
C:\mini_server_14\bin | C:\mini_server_14\bin> | ||
</pre> | |||
'''''[[#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> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>mysql --port=3314 --user=root --password=root | ||
mysql | mysql> USE mysql; | ||
mysql | mysql> UPDATE user SET user='mike' WHERE user='root'; | ||
mysql | mysql> FLUSH PRIVILEGES; | ||
mysql | mysql> quit | ||
</pre> | |||
'''''[[#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> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>mysql --port=3314 --user=root --password=root | ||
mysql | mysql> use mysql; | ||
mysql | mysql> DELETE FROM user WHERE user = 'root' AND host = '%'; | ||
mysql | mysql> FLUSH PRIVILEGES; | ||
mysql | mysql> quit | ||
</pre> | |||
'''''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> | |||
C:\mini_server_14\bin | C:\mini_server_14\bin>mysql --port=3314 --user=root --password=root | ||
mysql | mysql> use mysql; | ||
mysql | mysql> DELETE FROM user WHERE user = ''; | ||
mysql | mysql> FLUSH PRIVILEGES; | ||
mysql | mysql> quit | ||
</pre> | |||
'''''Note'':''' The mini server does not include an anonymous account. | '''''Note'':''' The mini server does not include an anonymous account. |