To create a MySQL user, group:
# Groupadd MySQL
# Useradd Mysql-m-s/sbin/nologin
To start a compilation installation:
# CD mysql-5.6.28
#./configure \
--prefix=/application/mysql5.6.28 \ #指定路径
--with-unix-socket-path=/application/mysql5.6.28/tmp/mysql.sock \ #指定sock的路径
Localstatedir=/application/mysql5.6.28/data \ #数据路径
--enable-assembler \ #
--enable-thread-safe-client \
--with-mysqld-user=mysql \
--with-big-tables \
--without-debug \
--with-pathread \
--enable-assembler \
--with-extra-charsets=complex \
--with-readline \
--WITH-SSL \
--with-embedded-server \
--enable-local-infile \
--with-plugins=partition,innobase \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static \
# make
# make Install
Copy the configuration file:
# CP/HOME/ALEX/TOOLS/MYSQL-5.1.72/SUPPORT-FILES/MY-SMALL.CNF/ETC/MY.CNF
To create a data catalog:
# mkdir/application/mysql/data-p
Modify the user groups and users of the data catalog:
# Chown-r Mysql.mysql/application/mysql/data
Initialize the database:
#/application/mysql/bin/mysql_install_db--basedir=/application/mysql--datadir=/application/mysql/data--user= Mysql
To start the MySQL service:
#/application/mysql/bin/mysqld_safe &
View Port 3306 to see if the service is started:
# NETSTAT-TUNPL |grep 3306
To set a password for a mysqlroot user:
# mysqladmin-uroot password ' redhat '
MySQL Simple statement:
Querying MySQL Users
Select User,host from Mysql.user;
To delete a user who is the root host localhost
drop user [email protected];
To remove a user who is an empty host for localhost
Drop user "" @localhost;
Update Mysql.user This library
Update mysql.user set host= ' localhost ' where user= ' root ' and host= ' 127.0.0.1 ';
Alex will update the following PHP error resolution for you, I hope that the above blog for Linux enthusiasts to use ~ ~
Linux Operational Communication Group: 288746884
This article is from the "11794562" blog, please be sure to keep this source http://11804562.blog.51cto.com/11794562/1899622
MySQL compilation installation