MySQL

 
 
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: https://www.mysql.com

MySQL online manual can be found at: https://dev.mysql.com/doc/index.html

The latest MySQL version can be downloaded from: https://dev.mysql.com/downloads/index.html







Installing MySQL 3.23.



Information
none

Operating system used
Windows XP Home Edition Version 5.1 SP 2

Software prerequisites
none

Procedure
  1. Download and unzip mysql-3.23.55-win.zip
    Note: MySQL Reference manual can be found in ..\mysql\docs\

  2. Execute setup.exe to install MySQL Servers and Clients on your computer.

  3. Select the destination folder "mysql", e.g.: C:\Tools\mysql
    Note: We will not change the data directory located at ..\mysql\data

  4. Next step is to prepare the Windows MySQL Environment using the WinMySQLadmin tool.
    Execute file C:\..\mysql\bin>winmysqladmin.exe

    The WinMySQLadmin window will disapper after a few seconds and an icon MySQL stoplight will appear in the system bar. Just click on the icon and select "show me". The WinMySQLadmin window will be displayed.
    • Select "my.ini Setup" Tab
    • Check if Base Dir=C:/Tools/mysql
    • Press button: Pick-up and Edit my.ini" file
    • Add the following lines:

      [mysqld]
      basedir=C:/Tools/mysql
      datadir=C:/Tools/mysql/data
      skip-innodb


      You must add the lines basedir and datadir in the "my.ini Setup" Tab.
      If you do not add these lines, MySQL can NOT be run as a service on Windows NT/2000/XP.
    • Select radio button: mysqld-nt (See Note 1)
    • Press button: Save Modifications

    You should see the following:

    WinMySQLadmin

    Note 1:
    The Windows distribution includes both the normal and the MySQL-Max server binaries. Here is a list of the different MySQL servers you can use:

    Binary Description
    mysqld Compiled with full debugging and automatic memory allocation checking, symbolic links, InnoDB, and BDB tables.
    mysqld-opt Optimised binary with no support for transactional tables.
    mysqld-nt Optimised binary for NT/2000/XP with support for named pipes. You can run this version on Windows 9x/Me, but in this case no named pipes are created and you must have TCP/IP installed.
    mysqld-max Optimised binary with support for symbolic links, InnoDB and BDB tables.
    mysqld-max-nt Like mysqld-max, but compiled with support for named pipes.

  5. Open a DOS window.
    Start MySQL server: C:\..\mysql\bin>mysqld-nt --standalone
    Note: No messages will be displayed.

  6. Close the DOS window.

  7. Start winmysqladmin.exe and select "Err File" tab, you should see:
    mysqld-nt: ready for connections.
    Note: The yellow light is also burning: MySQL stoplight yellow



  8. You can test whether MySQL is working by executing the following (DOS) commands:
    C:\..\mysql\bin>mysqlshow
    C:\..\mysql\bin>mysqlshow -u root mysql
    C:\..\mysql\bin>mysqladmin version status proc
    C:\..\mysql\bin>mysql test


  9. If you want to install MySQL as a service on Windows NT/2000/XP, you must execute the following commands:
    • Service started automatically during boot process.
      C:\..\mysql\bin>mysqld-nt --install
      In the Windows Services window you should see: mysql service
    • Service NOT started automatically during boot process.
      C:\..mysql\bin>mysqld-nt --install-manual
      In the Windows Services window you should see: mysql service
    • To remove MySQL as a service on Windows NT/2000/XP
      C:\..\mysql\bin>mysqld-nt --remove

  10. Start the command line MySQL monitor:
    C:\..\mysql\bin>mysql -u root

  11. 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='';
    mysql> quit
    C:\..\mysql\bin>mysqladmin reload
    C:\..\mysql\bin>mysqladmin -uroot password mysecret


  12. An overview of a few commands which can be executed within directory C:\..\mysql\bin>:

    Command Description
    mysqlshow -? Displays the help of mysqlshow. This command shows the structure of a mysql database.
    mysqlshow -u<user>
    -p<password> <database>
    Example: Display table names of a selected database.
    mysqlshow -uroot -pmysecret mobilefishdb
    mysqladmin -? 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
    mysqladmin -u
    -p<old_password> password <new_password>
    Example: Change password into "mynewsecret" for user root.
    mysqladmin -uroot -pmysecret password mynewsecret
    mysql -? Displays the help of mysql. This command starts the command line MySQL monitor.
    mysql -u<user>
    -p<password>
    Example: Starts the command line MySQL monitor.
    mysqlshow -uroot -pmysecret