Original works, allow reprint, please be sure to use hyperlinks in the form of the original source of the article, author information and this statement. Otherwise, the legal liability will be investigated. http://cycnet.blog.51cto.com/117809/812625
Now the software is more and more good to install, especially in Ubuntu under the installation of software, there is no skill, just need to use apt-get inatll in the case of networking. Before you decide to install MySQL, determine if the system already has MySQL installed. Such as:
It can be seen that MySQL is not installed in the system. Perform the sudo apt-get install Mysql-server my-client below. :
Enter y into the installation interface, during the installation process, will pop up an interface required to enter the root of the MySQL password, here must input, save the installation and then set the password. Such as
Then you will be asked to confirm, then lose again, then the system will automatically install MySQL until completed.
After the MySQL installation is complete, we can check to see if the system already has the MySQL service through Netstat-tap|grep MySQL, for example,
The above information appears stating that we have successfully installed MySQL.
The following is a simple configuration
After the installation is complete, modify the/ETC/MYSQL/MY.CNF (this file is the MySQL profile). Comment out the binding-address=127.0.0.1 in the file. Other configurations are changed as needed.
Login Database command: mysql-u root-p Enter the password we set earlier, you can log in successfully.
If you want to see the character set used by the database, you can enter show variables like ' character% ';(note that semicolons must not be omitted)
If you want to change these, you can change them in my.cnf.
This installs MySQL successfully.
Introduce several common commands for MySQL
First, the library operation
1. Create a database
Command: Create databases < database name >
For example, to create a database named Test
mysql> CREATE DATABASE test;
2. Show all databases
Command: Show databases
mysql> show databases;
3. Delete Database
Command: Drop databases < database name >
Example: Delete a database named test
mysql> drop database test;
4. Connect to the database
Command: Use < database name >
For example: If the test database exists, try to access it:
mysql> use test;
Screen tip: Database changed
5. View the database currently in use
Mysql> Select Database ();
6. The current database contains table information:
Mysql> Show tables;
MySQL's exit command is quit or exit. When I quit, I entered exit and asked me to add another one;
The others have no time to write again. It is written here, all things have to go through their hands to know what is going on, no matter how much to try.
This article is from the "cycnet" blog, make sure to keep this source http://cycnet.blog.51cto.com/117809/812625