Installation - MySQL 5 on Windows
From SONIVIS:Wiki
| | PREVIOUS STEP: Installing GNU R |
This is a guide for installing and configuring MySQL (tested with MySQL 5.0.45 Win32 on Windows XP Professional SP2). After the installation you can use prepared databases we offer as download here.
Installation
- Download and unpack MySQL Server. There are two versions available: Windows MSI Installer and an version without installer (unzip in C:\). We recommend the first alternative.
- Start the installation by execution *.msi.
- Choose the Custom Setup.
- Change the installation directory to C:\Programme\MySQL\.
- Enable Configure the MySQL Server now. Thus the configuration menu opens immediately.
Alternatively you may use the XAMPP or XAMPP Lite stack.
Furthermore, we recommend to download MySQL GUI Tools as well, including MySQL Administrator, MySQL QueryBrowser and MySQL MigrationToolkit. All these tools are very helpful for working with mySQL databases.
Configuration
- Choose the Standard Configuration.
- Disable Install As Windows Service. Enable Include Bin Directory in Windows PATH.
skip-innodbwith
#skip-innodb
Start and stop MySQL
Start MySQL
Start cmd and type:
...> cd C:\Programme\MySQL C:\Programme\MySQL> bin\mysqld-nt --defaults-file=my.ini --standalone --console
(Do not close the cmd window.)
Stop MySQL
Start cmd and type:
...> cd C:\Programme\MySQL C:\Programme\MySQL> bin\mysqladmin --user=root shutdown
Use batch-files for starting and stoping MySQL in Windows
- Download mysql_start.7z and mysql_stop.7z.
- Unpack the files to C:\Programme\MySQL.
- Start MySQL with mysql_start.bat (Do not close the window.)
- Stop MySQL with mysql_stop.bat (This will be closed the mysql_start.bat window.)
Usage of databases
You can use the provided connection to a database or download databases offered here.
Export databases
[YourDatabaseServerDirectory]/mysql/bin>mysqldump -u {User} --opt --default-character-set=utf8 {database} > {database}.sql
Import databases
- Run cmd (Windows) and type:
[YourDatabaseServerDirectory]/mysql/bin>mysql -u root -p [DBName] < [SQLFile]
# Dependent on the SQL file you have to create the database before: [YourDatabaseServerDirectory]/mysql/bin>mysql -u root -p --execute="create database [DBName]"
Install MySQL
You may use the XAMPP stack.
Configuration
After installation please edit my.cnf (located atlampp/etc/) and enable InnoDB engine by replacing skip-innodbwith
#skip-innodb
Start and Stop of MySQL of XAMPP
sudo /opt/lampp/lampp startmysql
and
sudo /opt/lampp/lampp stopmysql
Usage of databases
You can use the provided connection to a database or download databases offered here.
Copy databases from one location to another
# Probably you have to create the database before:
[YourDirectory]>/opt/lampp/bin/mysql -u{User} -p{Password} --execute="create database {database}"
[YourDirectory]>/opt/lampp/bin/mysqldump -u{User} -h{Host} -p{Password} {database} | /opt/lampp/bin/mysql -u{User} -h{Host} -p{Password} {database}
Export databases
[YourDirectory]>mysqldump -u{User} -h{Host} -p{Password} --opt --default-character-set=utf8 {database} > {database}.sql
Import databases
# Dependent on the SQL file you have to create the database before:
[YourDirectory]>/opt/lampp/bin/mysql -u{User} -p{Password} --execute="create database {database}"
[YourDirectory]>/opt/lampp/bin/mysql -u{User} -p{Password} {database} < {database}.sql
Managing MySQL under Linux
Under normal conditions, MySQL will be automatically started at the system startup.
If you have to manually stop and start it again, you will need sudo or root privileges to type the following in the command line (note the '#' symbol indicating root privileges):
- Start MySQL: # mysqld_safe &
- Stop MySQL: # mysqladmin -u root -p shutdown (then introduce your MySQL root passw when prompted to do so)
Or type sudo before each command above.
| | NEXT STEP: Installing Eclipse |

