1 Installing the server
sudo apt-get install Mysql-server
2 Installing the Client
sudo apt-get install mysql-client
sudo apt-get install Libmysqlclient-dev
The installation process needs to set the user name password, do not forget
3 Check if there is a MySQL service in the system, the following is probably the success
Netstat-tap|grep MySQL
TCP 0 0 *:mysql *:* LISTEN
4 Simple configuration
4.1 Set the database encoding to open the configuration file my.cnf
sudo nano/etc/mysql/my.cnf
Modify the following location
[Client]port = 3306socket =/var/run/mysqld/mysqld.sock# increases the character encoding of the client Default-character-set=utf8
[Mysqld] #增加服务器端的字符编码character-set-server=utf8collation-server=utf8_general_ci
4.2 Let the server remotely access or configure the file my.cnf
#注释bind-address#bind-address = 127.0.0.1
4.3 Initializing the root password
Set = password ("root");
5 Introduction to Common commands
5.1 Login to the database,-u followed by the user name, enter after entering the password can be
5.2 Viewing the database character set
Show variables like ' character% ';
5.3 Creating a Database
Create databases < database name >
5.4 Show All databases
show databases;
5.5 Deleting a database
Drop databases < database name >
5.6 Linked databases
Use < database name >
5.7 Viewing the currently used database
Select Database ()
5.8 View current database table information
Show tables
5.9 Exit
Exit
| 1 |
SET PASSWORD =&NBSP; password (" root "); |
Install MySQL under Ubuntu 14.10