Installing MySQL on Ubuntu is simple and requires only a few command lines
1 Installing the server
sudo apt-get install Mysql-server
2 Installing the Client
sudo apt-get install mysql-client
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 6153
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 3306 Socket =/var/run/mysqld/mysqld. sock # increase the character encoding of the client Default-character-set=utf8
[Mysqld] # Add a server-side character encoding character-set-server=utf8collation-server=utf8_general_ci
4.2 Let the server remotely access or configure the file my.cnf
# Note bind-address#bind-address = 127.0.0.1
5 Introduction to Common commands
5.1 Login to the database,-u followed by the user name, enter after entering the password can be
Mysql-u root-p
5.2 Viewing the database character set
' 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
Install MySQL under Ubuntu 14.10