Installing MySQL
时间:2007-12-20 来源:xilen2099
1.creat account
$ pw groupadd mysql
$ pw useradd mysql -c "MySQL Server" -d /dev/null -g mysql -s /sbin/nologin
2.Compiling MySQL
$ ./configure --prefix=/usr/local/mysql --with-mysqld-user=mysql --with-unix-socket-path=/tmp/mysql.sock --with-mysqld-ldflags=-all-static //在同一行
$ make
$ make install
$ strip /usr/local/mysql/libexec/mysqld //进入mysql目录后执行
$ scripts/mysql_install_db
$ chown -R root /usr/local/mysql
$ chown -R mysql /usr/local/mysql/var
$ chgrp -R mysql /usr/local/mysql
3.Copy configuration file
$ cp support-files/my-medium.cnf /etc/my.cnf
$ chown root:sys /etc/my.cnf
$ chmod 644 /etc/my.cnf
4.Start the server
$ /usr/local/mysql/bin/mysqld_safe &
5.Test the connection
Try to establish a connection with the database as follows:
$ /usr/local/mysql/bin/mysql -u root mysql
mysql> show databases;
mysql> quit;
6.shutdown the database
/usr/local/mysql/bin/mysqladmin -u root shutdown
$ pw groupadd mysql
$ pw useradd mysql -c "MySQL Server" -d /dev/null -g mysql -s /sbin/nologin
2.Compiling MySQL
$ ./configure --prefix=/usr/local/mysql --with-mysqld-user=mysql --with-unix-socket-path=/tmp/mysql.sock --with-mysqld-ldflags=-all-static //在同一行
$ make
$ make install
$ strip /usr/local/mysql/libexec/mysqld //进入mysql目录后执行
$ scripts/mysql_install_db
$ chown -R root /usr/local/mysql
$ chown -R mysql /usr/local/mysql/var
$ chgrp -R mysql /usr/local/mysql
3.Copy configuration file
$ cp support-files/my-medium.cnf /etc/my.cnf
$ chown root:sys /etc/my.cnf
$ chmod 644 /etc/my.cnf
4.Start the server
$ /usr/local/mysql/bin/mysqld_safe &
5.Test the connection
Try to establish a connection with the database as follows:
$ /usr/local/mysql/bin/mysql -u root mysql
mysql> show databases;
mysql> quit;
6.shutdown the database
/usr/local/mysql/bin/mysqladmin -u root shutdown
相关阅读 更多 +