Install MySQL offline package and related configurations in Ubuntu

Source: Internet
Author: User
Install MySQL in Ubuntu: 1. Install sudoapt-getinstallmysql-server on the Internet. Environment Variables automatically configured after installation can be directly used

Install MySQL in Ubuntu: 1. install sudo apt-get install mysql-server on the Internet. Environment Variables automatically configured after installation can be directly used

Install MySQL in Ubuntu in three ways:

1. install sudo apt-get install mysql-server from the Internet. After the environment variables have been automatically configured, you can directly use the mysql command.

2. Install the release package. Take mysql-5.0.45-linux-i686-icc-glibc23.tar.gz as an example.

3. Binary Package installation: environment variables have been automatically configured after installation. You can directly use the mysql Command

Online installation and Binary Package installation are relatively simple, with emphasis on installing the MySQL offline package under Ubuntu.

1. groupadd mysql

2. mkdir/home/mysql

3. useradd-g mysql-d/home/mysql

4. copy the mysql-5.0.45-linux-i686-icc-glibc23.tar.gz to the/usr/local directory

5. Unzip the tar zxvf mysql-5.0.45-linux-i686-icc-glibc23.tar.gz

6. ln-s mysql-5.0.45-linux-i686-icc-glibc23 mysql

7. cd/usr/local/mysql

8. chown-R mysql.

9. chgrp-R mysql.

10. scripts/mysql_install_db -- user = mysql (Be sure to run the command in the mysql directory. Note that the output text contains the command to change the root password and start mysql)

11. Set the password for root:./bin/mysqladmin-u root password 'passw0rd'

Configure and manage msyql:

1. Modify mysql Max connections: cp support-files/my-medium.cnf./my. cnf, vim my. cnf, add or modify max_connections = 1024

For my. cnf: mysql, search for my. cnf:/etc, mysql installation directory, and data under the installation directory in the following order. /Etc is set globally.

2. Start mysql:/usr/local/mysql/bin/mysqld_safe -- user = mysql &

3. Stop mysql: mysqladmin-uroot-ppassw0rd shutdown. Note that there is no space after u or p.

4. Set mysql auto-start: add the startup command to the/etc/rc. local file.

5. Allow remote root login:

1) log on to mysql on the local machine: mysql-u root-p (-p must be available); change the database: use mysql;

2) from all hosts: grant all privileges on *. * to root @ "%" identified by "passw0rd" with grant option;

3) grant all privileges on *. * to root @ "192.168.11.205" identified by "passw0rd" with grant option; flush privileges;

4) Go to the mysql database to check whether the data with host % is added: use mysql; select * from user;

6. Create a database and create a user:

1) database creation: create database test1;

2) create a user and grant permissions: grant all privileges on test1. * to user_test @ "%" identified by "passw0rd" with grant option;

3) delete a database: drop database test1;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.