Home > Database > Mysql Tutorial > body text

Linux系统下源码安装MySQL5.0.18(源码包)

WBOY
Release: 2016-06-07 16:51:31
Original
942 people have browsed it

所有这些操作在Linux系统下进行,需要root权限安装开始:shellgt; groupadd mysqlshellgt; useradd -g mysql mysqlshellgt; gu

所有这些操作在Linux系统下进行,需要root权限

安装开始:

shell> groupadd mysql

shell> useradd -g mysql mysql

shell> gunzip

shell> cd mysql-VERSION

shell> ./configure --prefix=/usr/local/mysql --with-charset=gb2312

shell> make

shell> make install

shell> cp support-files/my-medium.cnf /etc/my.cnf

shell> cd /usr/local/mysql

shell> bin/mysql_install_db --user=mysql

shell> chown -R root .

shell> chown -R mysql var

shell> chgrp -R mysql .

shell> bin/mysqld_safe --user=mysql &

(用mysql用户启动很重要。)

shell> bin/mysql -uroot -p

(输入密码,默认密码为空,直接回车即可)

shell> Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

如果出现上面的提示,说明mysql服务没有正常启动,因为mysql服务启动的话,会自动生成mysql.sock文件

shell> killall mysql

杀掉所有mysql进程,重新启动

shell> bin/mysql_install_db --user=mysql

重新启动

shell> bin/mysql -uroot -p

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template