1、登录系统后,进入源码压缩包解压文件,解压命令:tar –zxvf mysql-5.6.1蚀卺垦肝7-linux-glib艘早祓胂c2.5-i686.tar.gz,解压完成后移动解压文件到/usr/local/mysql 移动命令:mv mysql-5.6.17-linux-glibc2.5-i686 /usr/local/mysql。添加mysql组及用户cd /usr/local/mysqlgroupadd mysqluseradd -r -g mysql mysql设置权限chown -R mysql:mysql /usr/local/mysqlchown -R root /usr/local/mysqlchown -R mysql /usr/local/mysql/data先新建/etc/init.d/mysqld目录 执行:mkdir /etc/init.d/mysqld复制权限文件 cp support-files/mysql.server /etc/init.d/mysqld/mysql.server重命名权限文件 mv /etc/init.d/mysqld/mysql.server /etc/init.d/mysqld/mysqld.server初始化Mysql命令: scripts/mysql_install_db --user=mysq
2、启动及进入Mysql(1)启动:bin/mysqld_safe --user=mysql &(2)进入/usr/local/mysql/bin目录:执行: ./mysql -u root ;(3)进入/usr/local/mysql/bin目录:给root用户添加密码为root 执行:./mysqladmin -u root password 'root'
3、如果要远程访问mysql则要修改访问权限进入/usr/local/mysql/bin目录:.执行:./mysql -u root -p输入密码:root执行:GR帆歌达缒ANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;flush privileges;
4、配置mysql事件自启动vi /usr/local/mysql/my.cnf在[mysqld]下面添加event_scheduler = 1max_allowed_packet = 20M