Egg Student Movement -7:mysql Service installation configuration

Source: Internet
Author: User
Tags mysql in

MySQL Database binaries installation-(mysql-172.16.1.6)

1. Create Users and directories

Useradd mysql-s/sbin/nologin-m

Mkdir/application

2. Download Unzip

Tar XF mysql-5.5.32-linux2.6-x86_64.tar.gz

MV Mysql-5.5.32-linux2.6-x86_64 mysql-5.5.32

Ln-s/application/mysql-5.5.32/application/mysql

Chown-r Mysql.mysql/application/mysql

3. Initializing the database

/application/mysql/scripts/mysql_install_db--basedir=/application/mysql/--datadir=/application/mysql/data/-- User=mysql

4. Build the configuration file

Cp/application/mysql/support-files/my-small.cnf/etc/my.cnf

Cat/application/mysql/bin/mysqld_safe

5. Modify the binary package boot path and start MySQL in the background

Sed-i ' S#/usr/local/mysql#/application/mysql#g '/application/mysql/bin/mysqld_safe

/application/mysql/bin/mysqld_safe &

6. Modifying environment variables

Echo $PATH

cp/application/mysql/bin/*/usr/local/sbin/

7. Login Test

Mysql

Exit

8. Configure the optimized startup mode

Cp/application/mysql/support-files/mysql.server/etc/init.d/mysqld

Sed-i ' S#/usr/local/mysql#/application/mysql#g '/etc/init.d/mysqld

chmod +x/etc/init.d/mysqld

Killall MySQL

Lsof-i: 3306

Killall mysqld

Lsof-i: 3306

Netstat-lntup | grep MySQL

/etc/init.d/mysqld start

Chkconfig mysqld on

Chkconfig--list mysqld

9. Setting and changing passwords

Mysqladmin-uroot password "Oldboy"

Mysqladmin-uroot-poldboy password "123456"

10. Login command with password

mysql-uroot-p123456

Mysql-uroot-p

11.mysql Simple Operation command

show databases;

Use MySQL;

Show Tablesl

Select User,host from Mysql.user;

Select User ();

Select Database ();

Drop database databasename;

Drop user ' username ' @ ' hostname ';


This article is from the "Stressed Eggs" blog, please be sure to keep this source http://78124107.blog.51cto.com/5557978/1972006

Egg Student Movement -7:mysql Service installation configuration

Related Article

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.