1. Create a mysql user and user group (it seems that installation is not affected if the user is not created, but security needs to be re-planned ).
2. Compile and install (-- prefix =/usr/local/mysql -- with-charset = utf8 specifies the directory to be installed and the encoding to be used ).
3. initialize the database (mysql_install_db -- user = mysql). This database must be initialized. It is easy for cainiao to forget that if it is not installed, mysqld_safe cannot be started and some inexplicable errors will be reported.
4. Start mysql (mysqld_safe &)
5. set the password for the root user (mysqladmin-u root password 123456). This password is easy for cainiao to mix with mysql logon commands. Here, the password parameter is set to password, the password parameter used for logon is-p (for example, 6 ).
6. log on to mysql (mysql-u root-p) and press enter to enter the password.
7. mysql basic commands (the end can be fully executed with a semicolon,> Yes prompt)
> Show databases; // view all databases in mysql
> Use test; // switch to the test database for operations
> Show tables; // view all tables in the current database
> Create database gaso; // create a new database named gaso
> Select version (); // view the mysql version
> Use gaso;
> Create table gasotab (I int );
> Insert into gasotab values (6688 );
> Select * from gasotab; // create a test table in the gaso database. Insert the value and view the result.
> Show processlist; // view the mysql session List
> Show variables like 'character \ _ set \ _ % '; // view the character set used by mysql.