linux系统Mysql5.6下载与安装
1、下载地址 2、安装说明
3、安装步骤:
shell> groupadd mysqlshell> useradd -r -g mysql -s /bin/false mysqlshell> cd /usr/localshell> tar zxvf /path/to/mysql-VERSION-OS.tar.gzshell> ln -s full-path-to-mysql-VERSION-OS mysqlshell> cd mysqlshell> chown -R mysql .shell> chgrp -R mysql .shell> scripts/mysql_install_db --user=mysqlshell> chown -R root .shell> chown -R mysql datashell> bin/mysqld_safe --user=mysql &# Next command is optional shell> cp support-files/mysql.server /etc/init.d/mysql.server
4、安装完成后,设置root密码(安装很多遍,一直没仔细看过这个说明)
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: ./bin/mysqladmin -u root password 'new-password' ./bin/mysqladmin -u root -h localhost.localdomain password 'new-password' Alternatively you can run: ./bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd . ; ./bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd mysql-test ; perl mysql-test-run.pl
提示mysql命令不存在:ln -s /usr/local/mysql/bin/mysql /usr/bin
5、安装后,用/usr/local/mysql/bin/mysql -u root -p 进入报错/usr/local/mysql/bin/mysql: unknown variable 'datadir=/data1/mysql/var/'
这里需要修改my.cnf 配置问题 :
[client]#password = your_passwordport = 3306socket = /tmp/mysql.sockdatadir = /data1/mysql/var/ #把这里已到下方mysqld部分里[mysqld]port = 3306socket = /tmp/mysql.sockdatadir = /data1/mysql/var/ #加这里