MySql installation steps: graphic tutorials and Chinese garbled solutions; mysql Installation Steps

Source: Internet
Author: User

MySql installation steps: graphic tutorials and Chinese garbled solutions; mysql Installation Steps

The steps for installing MySql Server are as follows:

1. Install MySql Server

2. Install the MySqlServer management tool

Decompress the Chinese Language Pack and copy the file to the installation directory to overwrite

After the file is overwritten, open the software and set the language to Chinese (CN)

3 MySqlServer development considerations (C #)

1. connection string: "Server = localhost; Database = 100; Uid = root; Pwd = 'root '"

2. Reference MySql. Data. dll; using MySql. Data. MySqlClient;

3. Use MySqlConnection, MySqlParameter, MySqlDataAdapter, MySqlCommandBuilder, MySqlCommand, MySqlDataAdapter, MySqlTransaction, and other classes

5. If you want to Convert the object returned by the MySqlCommand. ExecuteScalar () method to the int type, you must use Convert for forced conversion. Otherwise, an error may occur.

6. When modifying a record, if the field data type is Bit, use True or False for the field value in the SQL statement, rather than 0 or 1 as in SQL Server.

7. command line tool:

Public class Cmd {// <summary> /// execute the Cmd command // </summary> /// <param name = "workingDirectory"> directory of the process to be started </param> /// <param name = "command"> command to be executed </param> public static void StartCmd (String workingDirectory, string command) {Process p = new Process (); p. startInfo. fileName = "cmd.exe"; p. startInfo. workingDirectory = workingDirectory; p. startInfo. useShellExecute = false; p. startInfo. redirectStandardInput = true; p. startInfo. redirectStandardOutput = true; p. startInfo. redirectStandardError = true; p. startInfo. createNoWindow = true; p. start (); p. standardInput. writeLine (command); Thread. sleep (10000); // p. standardInput. writeLine ("exit");} public static void StartCmd () {Process p = new Process (); p. startInfo. fileName = "cmd.exe"; p. startInfo. useShellExecute = false; p. startInfo. redirectStandardInput = true; p. startInfo. redirectStandardOutput = true; p. startInfo. redirectStandardError = true; p. startInfo. createNoWindow = true; p. start (); p. standardInput. writeLine ("net stop mysql"); Thread. sleep (5000); p. standardInput. writeLine ("net start mysql"); Thread. sleep (5000); p. standardInput. writeLine ("exit ");}}

Backup:

Public static bool BackUp (string backupPath) {try {// StringBuilder sbcommand = new StringBuilder (); sbcommand. appendFormat ("mysqldump-f-l-q-uroot-proot Sciendox50-r \" {0} \ "", backupPath); String command = sbcommand. toString (); // The path where mysqldump.exe is located. String appDirecroty = @ "C: \ Program Files \ MySQL Server 5.5 \ bin \"; Cmd. startCmd (appDirecroty, command); Cmd. startCmd (); // restart mysql MessageBox. sh Ow (@ "the database has been successfully backed up to" + backupPath + "file", "prompt", MessageBoxButtons. OK, MessageBoxIcon. information); return true;} catch (Exception) {MessageBox. show ("database backup failed! "); Return false ;}}

Restore:

/// <Summary> /// data restoration /// </summary> /// <param name = "FilePath"> file path </param> /// <returns> </returns> public static bool RestoreDB (string FilePath) {try {StringBuilder sbcommand = new StringBuilder (); // Add "" after the file path to avoid exceptions in the space sbcommand. appendFormat ("mysql-uroot-proot Sciendox50 <\" {0} \ "", FilePath); String command = sbcommand. toString (); // The path where mysql.exe is located. String appDirecroty = @ "C: \ Program Files \ MySQL Ser Ver 5.5 \ bin \ "; DialogResult result = MessageBox. Show (" Do you really want to overwrite the previous database? The previous database data will be lost !!! "," Warning ", MessageBoxButtons. yesNo, MessageBoxIcon. warning); if (result = DialogResult. yes) {Cmd. startCmd (appDirecroty, command); Cmd. startCmd (); // restart mysql MessageBox. show ("database restored successfully! "); Return true;} return false;} catch (Exception) {MessageBox. Show (" database restoration failed! "); Return false ;}}

The above is a graphic tutorial on MySql installation steps and a Chinese garbled solution. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.