The usual, ctrl+alt+t exhale terminal,
Input
sudo apt-get update
Update the source, or run the following code will be reported that a few packages can not be downloaded, you still have to come back to execute this code,
Input
sudo apt-get install mysql-server mysql-client
Note You will be prompted to enter your password during the execution of this code, which is the password for your database,
Input
sudo service MySQL restart
Restart the MySQL database, if the success of the installation is successful, otherwise, you understand, failed ...
Input
sudo apt-get install Libapache2-mod-auth-mysql
Let Apache support MySQL database
Input
Mysql-u root-p
Log in to the database, the password is the password set when the database was previously installed
Input
CREATE DATABASE ' project ' CHARACTER SET ' utf8 ' COLLATE ' utf8_general_ci ';
Create a database called Project and specify the character set as Utf-8 (otherwise the input character will be an error)
Input
CREATE TABLE login (username char) not Null,password char (+) not Null,id INT (a) NOT NULL Auto_increment,primary key (i d));
Create a data table named login and specify the ID as the primary key, specifying the data table character set as Utf-8;
show databases; View Database
Show tables; View Data Sheet
Of course, the use of terminal operation is often too cumbersome, so the third-party visualization software appears, such as: Mysql-workbench;
Input
sudo apt-get install Mysql-workbench
Install a third-party plugin, of course, in English, I try to set Simplified Chinese in Configure Fonts for, Preference, appearance, edit,
But it doesn't work.
--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------
As for how to use, I believe that smart you can get started with a look;
Install MySQL in Ubuntu