For some reason, it's time to install MySQL in the Ubuntu system, which has been installed many times before. It's not written down.
has been used to install the source code package, based on two reasons: 1. Always write code in Python. 2. Want to use the file to install, not through the API
This time using Deb-bundle package
1. Download the package:
For:
Http://115.156.188.226/cdn.mysql.com//Downloads/MySQL-5.6/mysql-server_5.6.28-1ubuntu14.04_amd64.deb-bundle.tar
2. Upload the package to the server and unzip the file
The decompression commands are:
tar –xvf mysql-server_5. 6.28-1ubuntu14.04_amd64.deb-bundle. Tar
Unzip to get a series of. deb files. In turn:
Libmysqlclient18_5.6.28-1ubuntu14.04_amd64.deblibmysqlclient-dev_5.6.28-1ubuntu14.04_amd64.deblibmysqld-dev_ 5.6.28-1ubuntu14.04_amd64.debmysql-client_5.6.28-1ubuntu14.04_amd64.debmysql-common_5.6.28-1ubuntu14.04_ amd64.debmysql-community-bench_5.6.28-1ubuntu14.04_amd64.debmysql-community-client_5.6.28-1ubuntu14.04_ amd64.debmysql-community-server_5.6.28-1ubuntu14.04_amd64.debmysql-community-source_5.6.28-1ubuntu14.04_ amd64.debmysql-community-test_5.6.28-1ubuntu14.04_amd64.debmysql-server_5.6.28-1ubuntu14.04_ Amd64.debmysql-testsuite_5.6.28-1ubuntu14.04_amd64.deb
3. installation files
There are dependencies on these files here, and if one is installed, install the order to install:
sudo dpkg-i mysql-common_5. 6.28-1ubuntu14.04_amd64.debsudo dpkg-i libmysqlclient18_5. 6.28-1ubuntu14.04_amd64.debsudo dpkg-i libmysqlclient-dev_5. 6.28-1ubuntu14.04_amd64.debsudo dpkg-i libmysqld-dev_5. 6.28-1ubuntu14.04_amd64.debsudo dpkg-i mysql-community-server_5. 6.28
Note that the root account password will be required to install Mysql-community-server
sudo dpkg-i mysql-server_5. 6.28
Here personally think the server should be able to use (not tested), but the MySQL command is not yet available
sudo dpkg-i mysql-community-client_5. 6.28-1ubuntu14.04_amd64.debsudo dpkg-i mysql-client_5. 6.28
Here, the installation of MySQL is complete
There are still a few files that are useless, but I don't know.
Mysql-community-bench_5. 6.28-1ubuntu14.04_amd64.debmysql-community-source_5. 6.28-1ubuntu14.04_amd64.debmysql-community-test_5. 6.28-1ubuntu14.04_amd64.debmysql-testsuite_5. 6.28-1ubuntu14.04_amd64.deb
4. Start and stop the MySQL service command
/etc/init.d/MySQL start/etc/init.d/mysql stop
5.mysql after installation, allowing users to access the server from other addresses
The first thing to do is to modify the/etc/mysql/my.cnf file
Bind-address 127.0. 0.1
Revision changed to
Bind-address 0.0. 0.0
Then you have to create a remote access user and give it access
There are actually several ways to create a user and give permissions. Here to use my personal favorite way, one in place, need to go into MySQL after executing commands
The script is as follows:
GRANT <all|priv1,priv2,..... privn> on[object'password'] [ With GRANT OPTION]; Max_queries_per_hour countmax_updates_per_hour countmax_connections_per_hour countmax_user_connections Count
Description: Priv represents permission Select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process, File, etc. 14 permissions
Example:
Select, Insert,update,delete,create,drop on test.hr to [email protected]192.168. 10.1 ' 123 '
Represents a permission for user John to create a select,insert,update,delete,create,drop from address 192.168.10.1 the HR table of the database test with a password of 123
Select, insert,update,delete,create,drop on * * to [email protected]'%' 123';
Represents the Select,insert,update,delete,create,drop permission for user John to create all libraries and tables for a database from any remote address, with a password of 123
You need to refresh permissions when you are done:
Flush privileges;
Ubuntu System install MySQL (deb-bundle pack)