shell> tar -zxvf mysql-5.5.28.tar.gz
shell> ln -s mysql-5.5.28 mysql
shell> cd mysql
shell> cmake .
---------------------
若运行 cmake报错Curses library not found 是因为 curses库没有安装,执行下面的语句即可
shell> yum -y install ncurses-devel
如果上述命令的结果是no package,则使用下面的命令安装
shell> apt-get install libncurses5-dev
----------------------
shell> make
shell> make install
# End of source-build specific instructions
# Postinstallation setup
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql #若提示权限不够,用命令:bash scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
# Next command is optional
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &
shell> bin/mysqladmin -uroot password 123456
shell> bin/mysql -uroot -p #输入此命令后,会提示你输入root用户密码123456(当然了,实际使用时密码不要设置这么简单!),
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysqld
shell> chkconfig --add mysqld
以后启动/停止数据库就可以使用下面的命令:
/etc/init.d/mysqld start #若提示权限不够,用命令:bash /etc/init.d/mysqld start
/etc/init.d/mysqld stop #若提示权限不够,用命令:bash /etc/init.d/mysqld stop
登录
/usr/local/mysql/bin/mysql -uroot -p
声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。