Mysql Installation steps graphics and text tutorials and Chinese garbled solution _mysql

Source: Internet
Author: User

The MYSQL server installation steps are as follows:

1 Installing MySQL Server

2 Installing MySQLServer management tools

Extract the Chinese Language pack and copy the files to the installation directory to overwrite

After the file is overwritten, open the Software Settings language for Chinese (CN)

3 MySQLServer Development Considerations (C #)

1. Join string: "SERVER=LOCALHOST;DATABASE=100; Uid=root; pwd= ' Root '

2. Quoting Mysql.data.dll;using MySql.Data.MySqlClient;

3. Use of Mysqlconnection, Mysqlparameter, Mysqldataadapter, Mysqlcommandbuilder, Mysqlcommand, MySqlDataAdapter, Mysqltransaction and other categories

5. Use Mysqlcommand. The object returned by the ExecuteScalar () method, if it is to be of type int, must be cast using convert, or you may get an error.

6. When modifying a record, the field value in the SQL statement is used ture or false when the field data type is bit type, and cannot be used as 0 or 1 as in SQL Server.

7. Command line tools:

public class cmd {///<summary>///execute CMD command///</summary>///<param name= "WorkingDirectory" > The order of the process to be started Record </param>///<param name= "command" > Command to execute </param> public static void Startcmd (String WorkingDirectory, String command) {process P = new process (); p.startinfo.filename = "cmd.exe"; p.startinfo.workingdirect
Ory = 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
{
//Build executed command
StringBuilder sbcommand = new StringBuilder ();
Sbcommand. AppendFormat ("Mysqldump-f-l-q-uroot-proot sciendox50-r" "{0}\" ", backuppath);
String command = Sbcommand. ToString ();
Get Mysqldump.exe the path
String appdirecroty = @ "C:\Program files\mysql\mysql Server 5.5\bin\";
Cmd.startcmd (appdirecroty, command);
Cmd.startcmd ()//reboot MySQL service
MessageBox.Show (@ "Database has been successfully backed up to + backuppath + file", "hint", MessageBoxButtons.OK, MessageBoxIcon.Information);
return true;
}
catch (Exception)
{
MessageBox.Show ("Database backup failed!") ");
return false;
}
}

Restores:

<summary>
///Data restore
///</summary>
///<param name= "FilePath" > File path </param>
///<returns></returns> public
static bool RestoreDB (string FilePath)
{
try
{
StringBuilder Sbcommand = new StringBuilder ();
After the file path, add "" to avoid a blank space occurrence
sbcommand. AppendFormat ("Mysql-uroot-proot Sciendox50 <\" {0}\ "", FilePath);
String command = Sbcommand. ToString ();
Get Mysql.exe the path
String appdirecroty = @ "C:\Program files\mysql\mysql Server 5.5\bin\";
DialogResult result = MessageBox.Show ("Do you really want to overwrite the previous database?") Then the previous database data will be lost!!! "," warns ", Messageboxbuttons.yesno, messageboxicon.warning);
if (result = = Dialogresult.yes)
{
cmd.startcmd (appdirecroty, command);
Cmd.startcmd ()//reboot MySQL service
messagebox.show ("Database restore succeeded!"). ");
return true;
}
return false;
}
catch (Exception)
{
MessageBox.Show ("database restore failed!)" ");
return false;
}
}

The above is a small set to introduce the MySQL installation steps graphics and text tutorials and Chinese garbled solution, hope to help everyone, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.