1 Preparatory work
2 dependencies required for installing MySQL
2.1 Installing Mysql
3 Common commands
3.1 Verify that the original host is installed
3.2 Start
3.3 Login
3.4 Telnet
3.5 Restart Service
3.6 Stop Service
3.7 View service Status
4 Error resolution
1 Preparatory work
This document is to install version 5.6 of MySQL under ubuntu14.04.
1. Software used: Ubuntu14.04
2. It is recommended to use the root user
3. Use server address: 192.168.1.236
4. Installing mysql5.6.19
2 dependencies required for installing MySQL
Install MySQL to rely on, otherwise start failed
Apt-get Install Mysql-client-core-5.6apt-get Install mysql-client-5.6
2.1 Installing Mysql
If you run the command-line message at the end, you see a similar
Apt-get Install mysql-server-5.6
Enter the root password during the installation process;
3 common commands
3.1 Verify that the original host is installed
Here is the main run of sudo netstat-tap | grep mysql command to see if there is a MySQL port, if not add sudo because the permissions can not be executed smoothly:
Netstat-tap | grep MySQL
3.2 Start
# start mysql$ sudo service MySQL start # close mysql$ sudo service mysql stop# restart mysql$ sudo service MySQL restart# other commands: $ sudo/ Etc/init.d/mysql start$ sudo/etc/init.d/mysql stop$ sudo/etc/init.d/mysql Restart
then, type the command again to check if MySQL has started:
$ NETSTAT-TAP | grep MySQL
MySQL listens on localhost, stating that MySQL is already started.
3.3 Login
Log in to MySQL using the command line mysql-u root-p:
$ mysql-u Root-p
3.4 Telnet
$ mysql -h192.168.1.160-u root-p
3.5 Restart Service
sudo service MySQL restart
3.6 Stop Service
sudo service MySQL stop
3.7 View service Status
4 Error resolution
================== ==================================================================
Error: "During installation of MySQL, this error is generally reported"
e:sub-process/usr/bin/dpkg returned an error code (1)
requires 2 root password set This error occurs as follows:
After this operation, 0 B of additional disk space would be used. Setting up mysql-server-5.5 (5.5.28-0ubuntu0.12.04.2) ... 121209 0:30:00 [Note] Plugin ' Federated ' is disabled.121209 0:30:00 innodb:the InnoDB memory heap is disabled121209 0:30: Innodb:mutexes and Rw_locks use GCC atomic builtins121209 0:30:00 innodb:compressed tables use zlib 1.2.3.4121209 0:3 0:00 innodb:initializing buffer pool, size = 128.0m121209 0:30:00 innodb:completed initialization of buffer pool121209 0 : 30:00 innodb:highest Supported file format is barracuda.121209 0:30:00 innodb:waiting for the background threads to STA rt121209 0:30:01 innodb:1.1.8 started; Log sequence number 1595675121209 0:30:01 innodb:starting shutdown ... 121209 0:30:01 Innodb:shutdown completed; Log sequence number 1595675AppArmor parser error for/etc/apparmor.d/usr.sbin.mysqld in/etc/apparmor.d/usr.sbin.mysqld At line 9:could not open ' Abstractions/mysql ' start:job failed to startinvoke-rc.d:initscript MySQL, action "start"Failed.dpkg:error processing mysql-server-5.5 (--configure): subprocess installed post-installation script returned Error exit Status 1dpkg:dependency problems prevent configuration of mysql-server:mysql-server depends on mysql-server-5. 5; However:package mysql-server-5.5 is not configured yet.dpkg:error processing mysql-server (--configure):d ependency Problems-leaving Unconfiguredno apport report written because the error message indicates it a followup error from a PR Evious failure. Errors were encountered while Processing:mysql-server-5.5mysql-servere:sub-process/usr/bin/dpkg returned an error code (1)
Workaround:
Use the command sudo apt-get install mysql-server
To uninstall MySQL:
sudo apt-get autoremove mysql*--purgesudo apt-get remove apparmorsudo apt-get install Mysql-server Mysql-common
Delete MySQL before ' Remember to delete/var/lib/mysql and/etc/mysql ' Anyway, check the MySQL path, and then delete all the files with MySQL to uninstall the full "
Install MySQL under Linux