Mysql installation and basic operation
Installation - From Cu BBS
1. Go to MySQL's Web Download 3.23 version, I use the src file, is a tar.gz compression package (about 10m or so) 2. Data according to the order of the instruction: (if there is a MySQL user and mysql group, you can pass PASS ) #groupadd mysql #useradd -g mysql mysql #gunzip
Installation 2 Enter Pack Shell> GroupAdd MySQL Shell> UserAdd -g MySQL Mysql Shell> CD / USR / LOCAL Shell> Gunzip LN -S mysql-version-os mysql shell> cd mysql shell> scripts / mysql_install_db shell> chown -r root / usr / local / mysql shell> chown -r mysql / usr / local / mysql / data shell> chgrp -r mysql / usr / Local / mysql shell> chown -r root / usr / local / mysql / bin shell> bin / safe_mysqld --user = mysql &
Mysql basic operation (rookie level)
1. Connect the MySQL Database: Format: MySQL -H Host Address -u User Name -P User Password, Local Mysql Server MySQL -U Root -P Enter, will prompt box, let you enter your password connection Remote MySQL server Mysql -h10.1.17.73 -uroot -plogin2, exiting mysql: command: exit3, about mysql password, (Note: just install successful mysql database root users have no password.) format: mysqladmin -u username -P old password Password New password, such as: add a password to the root user (in the case where the installation) Mysqladmin -uroot -Password login modifies the root password mysqladmin -uroot -Plogin Password Welcome4, the following is some of the most common database operations command: Show Databases // Display Database name use databases_name; show tables; // display structure describe table_name table in the database; // display the data table structure create database database_name; // create a database use database_name; create table table_name (field list); // create a table drop database database_name ; // Remove the database DROP TABLE TABLE_NAME; // Remove Table Delete from Table_Name; // Clear Table 5, turn the text data into the database (Note: Between the text data field, the null value is replaced with N. ) Data loading command: load data local infile "filename" INTO TABLE_NAME; Oh, I am also mysql's rookie, just in contact, the above is the most basic foundation, huh, the best mysql tutorial is "
"MySQL Chinese Reference Manual" translated, all major websites have downloaded, Google can find it.