一、数据库安装 1. 安装server、client: 目前统一使用版本为:MySQL-server-5.6.24-1.el6.x86_64.rpm,MySQL-client-5.6.24-1.el6.x86_64.rpm 下载地址: wget http://IP/app/MySQL-server-5.6.24-1.el6.x86_64.rpm wget http://IP/app/MySQL-client-5.6.24-1.el6.x86_64.rpm 安装命令: rpm -ivh --replacefiles MySQL-s*.rpm rpm -ivh --replacefiles MySQL-c*.rpm 要移除安装可以使用 rpm -e MySQL-server 、 rpm -e MySQL-devel、MySQL-client即可; 默认安装路径为: /usr/share/mysql 2. 初始化数据库: /usr/bin/mysql_install_db 3. 启动mysql服务: service mysql start 或 /etc/init.d/mysql.server start 4.第一次登陆设置root密码: 首先查看 cat /root/.mysql_secret 然后命令行:mysql -u root -p ,然后输入上面的密码即可 设置密码: SET PASSWORD = PASSWORD('PASSWD'); 5、安装问题处理: 1)丢失root密码的时候: service mysql stop mysqld_safe --skip-grant-tables& mysql -u root mysql mysql> UPDATE user SET password=PASSWORD("PASSWD") WHERE user='root'; mysql> FLUSH PRIVILEGES; 2)安装冲突 安装rpm -ivh MySQL-server-5.6.24-1.el6.x86_64.rpm 提示 file /usr/mysql/czech/errmsg.sys from install of MySQL-server-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64 一堆冲突,解决办法如下: yum -y remove mysql-libs-5.1.73* 3)将mysql的启动服务添加到系统服务中 cp /usr/share/mysql/mysql.server /etc/init.d/mysql 4)为root添加远程连接的能力 [root@ rhel5~]# mysql -u root mysql mysql>use mysql; mysql>desc user; mysql>GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root"; mysql>update user set Password = password('PASSWD') where User='root'; mysql>select Host,User,Password from user where User='root'; mysql>flush privileges; mysql>exit 二、优化参数配置 容量50G,内存2000MB,访问次数2400/秒,binlog日志不开启,默认路径为/usr/my.cnf # innodb_buffer_pool_size = 2G innodb_log_file_size=512M innodb_log_buffer_size=64M max_connections=800 key_buffer_size = 16M max_allowed_packet = 1G table_open_cache = 512 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M interactive_timeout=31536000 open_files_limit = 102400 #log-bin=mysql-bin #binlog_format=mixed
mysql5.6安装sys库_mysql数据库5.6.24安装与优化配置
最新推荐文章于 2020-12-30 10:23:30 发布