一、编译mysql 5.0.40
#cd /usr/local/src
# tar zxvf mysql-5.0.40.tar.gz
# cd mysql-5.0.46
#./configure --prefix=/usr/local/mysql --localstatedir=/var/lib/mysql --with-comment=Source --with-server-suffix=-enterprise-gpl --with-mysqld-user=mysql --without-debug --with-big-tables --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all --with-pthread --enable-static --enable-thread-safe-client --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler --without-ndb-debug --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
配置成功会提示:
MySQL has a Web site at http://www.mysql.com/
which carries details on the
latest release, upcoming features, and other information to make your
work or play with MySQL more productive. There you can also find
information about mailing lists for MySQL discussion.
Remember to check the platform specific part of the reference manual for
hints about installing MySQL on your platform. Also have a look at the
files in the Docs directory.
Thank you for choosing MySQL!
# make
编译的时间可能会比较长,毕竟优化的比较厉害。
# make install
编译安装完成后执行后续操作:
# useradd mysql //添加 mysql 用户
# cd /usr/local/mysql
# bin/mysql_install_db --user=mysql
# chown -R root:mysql . //设置权限,注意后面有一个 "."
# chown -R mysql /var/lib/mysql //设置 mysql 目录权限
# chgrp -R mysql . //注意后面有一个 "."
# cp share/mysql/my-large.cnf /etc/my.cnf
# cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld //开机自动启动 mysql。
# chmod 755 /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# /etc/init.d/mysqld start //启动 MySQL
#/usr/local/mysql/bin/mysqladmin -u root password "password_for_root" // password_for_root为密码.本机是mysql
#/usr/local/mysql/bin/mysql –u root –p //进入mysql客户端
(/usr/local/mysql/bin/mysql -u root -p 提示Enter password: 输入密码,回车进入)
# /etc/init.d/mysqld start //关闭 MySQL
远程连接时如了出现:
INSERT INTO mysql.user (Host,User,Password) VALUES('%','plain',PASSWORD('123456'));
ERROR 1130: is not allowed to connect to this MySQL server
第一重要:查看Linux防火墙是否关掉;
再来看:
进入Linux
登录Mysql:
首先使用update把mysql.user中的root的host从localhost修改成%:
mysql> UPDATE mysql.user SET Host='%' WHERE Host='localhost' ;
mysql>GRANT ALL PRIVILEGES ON *.* TO root@"%
";
mysql> FLUSH PRIVILEGES ;
再次连接,显示成功。
分享到:
相关推荐
mysql在linux下安装步骤,按照步骤执行就可以实现安装了,使用后就知道了啊
linux centos下下载配置安装mysql教程,有一定的参考价值
linux下安装mysql服务器
mysql 详细安装
Linux下安装Mysql数据库; Linux mysql rpm安装包 Linux mysql安装教程
mysql 在Linux上的安装说明过程。
mysql linux下安装时,存在以下错误: Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
二、安装Mysql 1、下载MySQL的安装文件 安装MySQL需要下面两个文件: MySQL-server-4.0.16-0.i386.rpm MySQL-client-4.0.16-0.i386.rpm 下载地址为:www.mysql.com/downloads/mysql-4.0.html,打开此...
linux下mySql安装 经典 实验无数次的经验linux下mySql安装 经典 实验无数次的经验linux下mySql安装 经典 实验无数次的经验linux下mySql安装 经典 实验无数次的经验linux下mySql安装 经典 实验无数次的经验linux下...
Mysql8.0-linux安装指导
Linux下安装mysqlLinux下安装mysqlLinux下安装mysqlLinux下安装mysql
mysql数据库在linux下的安装,包含单机版、主备安装、双主+keepalived安装、集群环境安装,所有文档内容均原创
mysql安装手册
编译安装方式,可以用于最新版本的,可以使实施
linux下mysql安装包,当使用编译安装时可以选择此包进行编译安装mysql5.6.29
Linux下安装mysql安装包安装及详细步骤 (有安装包及步奏 问题解答) Mysql数据库的安装对于开发者来说,是我们必然会面对的问题,它的安装过程其实并不复杂,并且网络上的安装教程也非常多,但是对于新手来说,各种...
mysql linux 安装 非常好的教材
linux下安装mysql注意事项及部署程序须知
linux安装jdk,tomcat,mysql