时间:2021-07-01 10:21:17 帮助过:43人阅读
$ yum install -y autoconf automake imake libxml2-devel expat-devel cmake gcc gcc-c++ libaio libaio-devel bzr bison ncurses5-devel
$ rpm -qa | grep mysql
$ rpm -e --nodeps XXX ----注:(XXX为上一条命令看到的所有条目)
$ cmake \
-DCMAKE_INSTALL_PREFIX=/app/mysql \
-DMYSQL_UNIX_ADDR=/app/mysql/conf/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_INNOBASE_STORAGE_engine=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DMYSQL_DATADIR=/app/mysql/data/mysqldb \
-DMYSQL_TCP_PORT=3306 \
-DENABLE_DOWNLOADS=1
$ make
$ make install
$ scripts/mysql_install_db --user=industry \
--basedir=/app/mysql \
--datadir=/app/mysql/data/mysqldb
$ vim ~/.bash_profile (编辑该文件加入下面的路径信息)
PATH=$PATH:/app/mysql/support-files
$ source ~/.bash_profile
$ bin/mysqld_safe --user=industry & --安全模式后台启动 ---重启步骤一
$ ./mysql.server {start stop status} --mysql 启动 停止 状态
$ mysql -h ‘192.168.3.77‘ -u root -p
SQL> use mysql;
SQL> GRANT all PRIVILEGES ON *.* TO ‘root‘@‘192.168.3.77‘ IDENTIFIED BY ‘passwd‘; --(其中IP地址可换为‘%’表示所有机器均可使用该密码连接;也可更换为‘localhost’,表示本机连接时的密码)
SQL> flush privileges;
SQL> set password for root@localhost = password(‘passwd‘);
SQL> set password for root@‘%‘ = password(‘passwd‘);
SQL> flush privileges;
源码编译方式安装mysql服务 (Centos 6.X)
标签:str bsp local pass basedir engine path mysql 启动 sock