|MySQL is a fast, multi-threaded, multi-user open source SQL database server.
The MySQL database is released under the GNU General Public License (GPL). MySQL can be used for free when you are not distributing any part of the MySQL system. For example: If you run a commercial web site using the MySQL Database Software as long as MySQL is not distributed.
Please read the MySQL manual for situations where a commercial license is needed.
More information about MySQL can be found at: http://www.mysql.com
MySQL online manual can be found at: http://dev.mysql.com/doc/index.html
The latest MySQL version can be downloaded from: http://dev.mysql.com/downloads/index.html
Installing MySQL 4.0.18.
Operating system used
Windows XP Home Edition Version 5.1 SP 2
- If you have previously installed MySQL 3.23 and you want to install a new MySQL version do the following (for an upgrade read the documentation):
- WARNING: THE FOLLOWING STEPS WILL COMPLETE REMOVE THE OLD MySQL INSTALLATION AND DATABASES. BE SURE IF YOU WANT TO DO THIS.
- Stop the current server.
Open a dos window and type: net stop mysql
- Remove the previously installed mysql service.
- Remove the old MySQL version:
Start | Settings | Configuration Screen | Software | Select MySQL | Remove
- Remove the old C:\..\mysql\ directory.
- Download and unzip mysql-4.0.18-win.zip
- Execute setup.exe to install MySQL Servers and Clients on your computer.
- Select the mysql destination folder, e.g.: C:\Tools\mysql.
- Select setup type: typical
- After installation you can find the MySQL Reference Manual in ..\mysql\Docs\
A more recent version of this document and other documents can be found at: http://www.mysql.com/documentation/
The data directory can be found in ..\mysql\data.
- Next step is to prepare the Windows MySQL Environment using the WinMySQLadmin tool.
Execute file C:\..\mysql\bin>winmysqladmin.exe
Enter a username and password. The username will be used as the default system administrator name, e.g.:
User name = myname
password = mysecret
WinMySQLadmin creates a c:\windows\my.ini configuration file and setup the MySQL service to start automatically when Windows starts.
- The WinMySQLadmin window will disapper and a stoplight icon will appear in the system bar. Just right click on the icon and select "show me". The WinMySQLadmin window will be displayed.
You should see the following:
- Select "my.ini Setup" Tab
- Check if Base Dir=C:/Tools/mysql
- Press button: Pick-up and Edit my.ini" file
- Verify if radio button mysqld-nt (see Note 1) is selected, otherwise select it.
- Press button: Save Modifications
- You should see:
#This File was made using the WinMySQLAdmin 1.4 Tool
#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions
#language=C:/Tools/mysql/share/your language directory
#slow query log#=
Here is a list of the different MySQL servers you can use:
||Compiled with full debugging and automatic memory allocation checking, symbolic links, InnoDB and BDB tables.
||Optimized binary. From version 4.0 on, InnoDB is enabled. Before 4.0, this server includes no transactional table support.
||Optimized binary for Windows NT, 2000, and XP with support for named pipes.
||Optimised binary with support for symbolic links, InnoDB and BDB tables.
||Like mysqld-max, but compiled with support for named pipes.
- Do not close the WinMySQLadmin window yet.
- Verify if the correct MySQL service is setup.
In the Windows Services window you should see:
Right click this service and select properties.
The path to executable file should be: C:/Tools/mysql/bin/mysqld-nt.exe
If this is NOT the case:
- Right click on the WinMySQLadmin window.
- Select Win NT | Stop the Service
- Again right click | Select Win NT | Remove the Service
- Again right click | Select Win NT | Install the Service
- Again right click | Select Win NT | Start the Service
- Now check if the correct MySQL service is setup.
- Close the WinMySQLadmin window.
- Start the command line MySQL monitor:
C:\..\mysql\bin>mysql -u root
You should see:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 4.0.18-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
- The default privileges on Windows give all local users full privileges to all databases without specifying a password. To make MySQL more secure, you should set a password for all users and remove the row in the mysql.user table that has Host='localhost' and User=' '.
You should also add a password for the root user. The following example starts by removing the anonymous user that has all privileges, then sets a root user password "mysecret":
mysql> use mysql
mysql> delete from user where host='localhost' and User='';
C:\..\mysql\bin>mysqladmin -uroot password mysecret
- An overview of a few commands which can be executed within directory C:\..\mysql\bin>:
||Displays the help of mysqlshow. This command shows the structure of a mysql database.
|Example: Display table names of a selected database.
mysqlshow -uroot -pmysecret mobilefishdb
||Displays the help of mysqladmin. This command executes the administration program for the mysqld daemon.
|mysqladmin -u<user> password <password>
||Example: Set password "mysecret" for user root.
mysqladmin -uroot password mysecret
-p<old_password> password <new_password>
|Example: Change password into "mynewsecret" for user root.
mysqladmin -uroot -pmysecret password mynewsecret
||Displays the help of mysql. This command starts the command line MySQL monitor.
|Example: Starts the command line MySQL monitor.
mysql -uroot -pmysecret