installing MySQL on Linux
Environment: Windows7
Virtual machine: Oracle Vmvirtualbox
Linux:ubuntukylin-14.04.1-amd64.iso
mysql:5.7.12
I. Environmental preparedness
Step1: Installing virtual machines
Step2: Modifying the host BIOS configuration
Operating system: Windows 7 64-bit;
Virtual machine: Oracle VM VirtualBox
Linux version: Ubuntu4.0 64
problem Description: There are no 64-bit system options in the list of new virtual machines
Workaround: Modify the BIOS configuration in the machine.
1): Restart the computer, press F2, enter the BIOS interface
2): Enter the Configure page, the virtualization parameter modified to: Enabled
3): Press F10 to save.
The 64-bit option appears when you start your computer and then create a new virtual machine operation.
step3: Install the Ubuntu system on the virtual machine. The memory is set to 4G, the hard disk is set to 100G, the rest is by default, the next step is selected. Until the system installation is successful.
Two. Install MySQL
Step1: Set the password for root
Enter sudo passwd root return, enter two times password, modify complete
Step2: switch to root user
Enter SU root return, enter the password, switch successful
step3: start installing MySQL
Refer to official website document: http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/
Enter the sudo apt-get install mysql-server carriage return for installation. You will be prompted to install the required disk space, enter "Y", the installer will automatically complete.
After installation, the system creates a database super user "root" and sets the password.
However, the default installation is version 5.5.
I want to use the latest version of the JSON attribute, which is 5.7, so I need to do the following
1, in the official website to obtain MySQL APT warehouse
wget Http://repo.mysql.com//mysql-apt-config_0.6.0-1_all.deb
2, installation
Dpkg-i Mysql-apt-config_0.6.0-1_all.deb
The following interface appears after the carriage return: Select the latest version 5.7
After selecting 5.7, select Apply
3, update the next apt-get update
4, remove the original installation of MySQL (maybe this time with upgrade can be directly upgraded, I did not try)
Apt-get Remove Mysql-server
Apt-get Remove Mysql-client
Apt-get Autoremove
5, install the new sudo apt-get install Mysql-server
ok,5.7 version of MySQL installation success!
Common commands:
i), start
1, use service to start: service MySQL Start
2. Start with mysqld script:/etc/inint.d/mysqlstart
3. Use Safe_mysqld to start:safe_mysql&
II), stop
1, use service to start: Service Mysqlstop
2. Start with mysqld script:/etc/inint.d/mysqlstop
3, mysqladmin shutdown
III), restart
1, use service to start: Service Mysqlrestart
2. Start with mysqld script:/etc/inint.d/mysqlrestart
Four), view service status
sudo service MySQL status
Third, the database in the host
install Navicat on this computer to connect to the database.
1. Error:1130-host ' 192.16.41.121 ' isnot allowed to connect to this MYSQL server
A ping between two machines
Telnet 192.16.41.121 3306 is also a pass
Workaround:
The account number is not allowed to log in from the remote, only in localhost. This time as long as the computer in localhost, login mysql, change the "MySQL" Database in the "User" table in the "host" item, from "localhost" renamed "%"
Mysql-u root-pvmwaremysql>use MySQL;
Mysql>updateuser Set host = '% ' where user = ' root ';
Mysql>selecthost, user from user;
In virtual machine Native input command: mysql-uroot-p Enter password, login successful
Select Host,user from user; View Permissions
2. Create a new table and perform a query error:
Table ' performance_schema.session_status ' doesn ' t exist.
Finally found the answer in the STACKOVERFLW, the main cause, the previous data is mysql5.5 in. Later, the MySQL is 5.7. The inconsistency between versions results.
1). Implementation: Mysql_upgrade-u root-p--force
2.) Restart MySQL
The above is the MySQL 5.7.12 installation configuration method, as well as the installation process encountered problems in the solution, I hope that the learning of everyone help.