Briefly under Ubuntu Linux install MySQL database
One. Installation
# Apt-get Install Mysql-server
# Apt-get Install Mysql-client
Two. Start
# sudo start MySQL
Check to see if monitoring is established
# Netstat-tap | grep MySQL
TCP 0 0 Localhost:mysql *:* LISTEN 15910/mysqld
Three. To cancel native unique access restrictions
/ETC/MYSQL/MY.CNF file, note this sentence bind-address = 127.0.0.1
Four MySQL related commands
Go to MySQL Console
Mysql-uroot-p
Enter your password to log in
1. Create a database
mysql>create [database name];
2. Display Number Library
Mysql>show databases;
3. Using the Database
Mysql>use [database name];
4. Create a table
Please note: The upper left corner of the keyboard is Instead of single quotes '
Mysql>create TABLE ' Ud1 ' (
[->] ' uid ' INT (Ten) not NULL DEFAULT ' 0 ',
[->] ' intro ' TEXT NULL,
[->] PRIMARY KEY (' uid ')
[->]);
Note: Here is the SQL statement, the keyword has to be capitalized
5. Display table
->mysql>show tables
6. Querying the contents of the table
Mysql> select * FROM [table name];
Ubuntu Install MySQL Database