linux build MySQL account

Login Linux system as root, mysql create groups and users [root @ Nagios-Server ~] # groupadd mysql

[root@Nagios-Server ~]# useradd mysql -g mysql -M -s /sbin/nologin [root@Nagios-Server ~]# tail -1   /etc/passwd mysql:x:501:501::/home/mysql:/sbin/nologin

The proportion currently using version mysql:

 

Mysql 5.1 –20%   Mysql 5.5 –60%   Mysql 5.6 –20%

 

# Install mysql error message:

 

checking for termcap functions library... configure: error: No curses/termcap library found

 

Solution # yum -y install ncurses-devel

 

# Installation Error Message

 

 

make[2]: *** [my_new.o] Error 127

 

make[2]: Leaving directory `/usr/local/src/mysql-5.0.41/mysys' make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/usr/local/src/mysql-5.0.41' make: *** [all] Error 2

# Create a soft link ln

 

[[email protected]]# ln -s /application/mysql5.1.72/ /application/mysql

 

[[email protected]]# ll /application/mysql

 

lrwxrwxrwx 1 root root 25 12 月   7 21:04 /application/mysql -> /application/mysql5.1.72/

 

# Note: If mysql and apache is not installed on the same day the service of words. Mysql installation to stop here! If on the same server, please proceed as follows:

[root@Nagios-Server tools]# ll mysql-5.1.72/support-files/my*.cnf

 

-rw-r--r-- 1 root root   4746 12 月 7 21:03 mysql-5.1.72/support-files/my-huge.cnf

 

-rw-r--r--        1         root         root         19779         12        月                           7        21:03 mysql-5.1.72/support-files/my-innodb-heavy-4G.cnf

-rw-r--r-- 1 root root   4720 12 月 7 21:03 mysql-5.1.72/support-files/my-large.cnf

 

-rw-r--r-- 1 root root   4731 12 月 7 21:03 mysql-5.1.72/support-files/my-medium.cnf

 

-rw-r--r-- 1 root root   2499 12 月 7 21:03 mysql-5.1.72/support-files/my-small.cnf

 

# My.cnf MySQL is the default configuration file name

 

[root@Nagios-Server tools]# cd mysql-5.1.72/support-files/ [root@Nagios-Server support-files]# cp my-small.cnf /etc/my.cnf cp:是否覆盖"/etc/my.cnf"?y

# Create a database file

 

[root@Nagios-Server support-files]# mkdir /application/mysql/data –p

 

[root@Nagios-Server support-files]# chown -R mysql.mysql /application/mysql/data/ [root@Nagios-Serversupport-files]#/application/mysql/bin/mysql_install_db

 

 

# There are two complete proof OK

 

141207 21:16:07 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.

OK

 

Filling help tables...

 

141207 21:16:08 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.

OK

 

# Generates two libraries

 

[root@Nagios-Server support-files]# ll /application/mysql/data/ 总用量 8

drwx ------ 2 mysql root 4096 12 Yue 7 21:16 mysql # system-related

 

drwx ------ 2 mysql root 4096 12 Yue 7 21:16 test # test

 

#mysql start

 

[root@Nagios-Server support-files]# /application/mysql/bin/mysqld_safe& [root@Nagios-Server support-files]# netstat -lntup|grepmysqld

# Adding detailed path started in the / etc / profile in

 

[root@Nagios-Server support-files]# vi /etc/profile

 

PATH="/application/mysql/bin/:$PATH"

 

# Take effect

 

[root@Nagios-Server support-files]# . /etc/profile

 

or

 

[root@Nagios-Server support-files]# source /etc/profile

 

# Login MySQL, view the database table

 

[root@Nagios-Server support-files]# mysql mysql> show databases;

 

+--------------------+

 

| Database                   |

 

+--------------------+

 

| information_schema |

 

| mysql                        |

 

| test                         |

 

+--------------------+

 

3 rows in set (0.00 sec)

 

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11328047.html