Mysql 5.6.24安装实例教程
安装前准备工作:
1)编辑PATH路径
vim/etc/profile PATH=/home/mysql/bin:/home/mysql/lib:$PATH exportPATH
2)生效PATH
source/etc/profile
3)编辑hosts
vim/etc/hosts 192.168.117.130cc-test
安装
1.环境配置
yuminstall-ygccgcc-c++makecmake
2.准备好安装包mysql-5.6.24.tar.gz,并将它拷贝到/home目录下
rz
3.解压安装包并更名
tar-zxvfmysql-5.6.2.tar.gz mvmysql-5.6.2.tar.gzmysql
4.新增用户组及用户
groupaddmysql useraddmysql-gmysql
5.创建data
mkdir/home/mysql/data
6.编译mysql
cmake\ -DCMAKE_INSTALL_PREFIX=/home/mysql\ -DMYSQL_UNIX_ADDR=/home/mysql/mysql.sock\ -DDEFAULT_CHARSET=utf8\ -DDEFAULT_COLLATION=utf8_general_ci\ -DWITH_MYISAM_STORAGE_ENGINE=1\ -DWITH_INNOBASE_STORAGE_ENGINE=1\ -DWITH_ARCHIVE_STORAGE_ENGINE=1\ -DWITH_BLACKHOLE_STORAGE_ENGINE=1\ -DWITH_MEMORY_STORAGE_ENGINE=1\ -DWITH_READLINE=1\ -DENABLED_LOCAL_INFILE=1\ -DMYSQL_DATADIR=/home/mysql/data\ -DMYSQL_USER=mysql\ -DMYSQL_TCP_PORT=3306
7.安装
makeinstall makeclean
8.修改目录拥有者
chown-Rmysql:mysql/home/mysql chown-Rmysql:mysql/home/mysql/data
9.初始化配置脚本
scripts/mysql-install-db--user=nysql--datadir=/home/mysql/data
10.重新更改权限
chown-Rmysql:mysql/home/mysql
11.复制服务器启动脚本
cp/home/mysql/support-files/mysql.server/etc/init.d/mysql chmod755/etc/init.d/mysql cp/home/mysql/support-files/my-default.cnf/etc/my.cnf
12.启动
servicemysqldstart
13.netstat-anp查看端口是否监听上
14.进入mysql
cd/mysql/bin ./mysql-uroot-p
问题1:
[root@cc-testmysql]#cmake.
出现以下错误提示:
--CouldNOTfindCurses(missing:CURSES_LIBRARYCURSES_INCLUDE_PATH) CMakeErroratcmake/readline.cmake:82(MESSAGE): Curseslibrarynotfound.Pleaseinstallappropriatepackage, removeCMakeCache.txtandreruncmake.OnDebian/Ubuntu,packagenameislibncurses5-dev,onRedhatandderivatesitisncurses-devel. CallStack(mostrecentcallfirst): cmake/readline.cmake:126(FIND_CURSES) cmake/readline.cmake:216(MYSQL_USE_BUNDLED_LIBEDIT) CMakeLists.txt:250(MYSQL_CHECK_READLINE) --Configuringincomplete,errorsoccurred!
解决方法:
[root@cc-testmysql]#rmCMakeCache.txt [root@cc-testmysql]#yuminstallncurses-devel Warning:BisonexecutablenotfoundinPATH --Configuringdone --Generatingdone --Buildfileshavebeenwrittento:/software/mysql-5.5.11 [root@cc-testmysql]#yuminstallbison [root@cc-testmysql]#cmake…… [root@cc-testmysql]#makeinstall
问题2:
[root@cc-testmysql]#scripts/mysql_install_db--user=mysql--datadir=/home/mysql/data -bash:scripts/mysql_install_db:Permissiondenied
解决方法:
[root@cc-testmysql]#chmod755scripts/mysql_install_db
问题3:
servicemysqldstart启动时发生PID错误
解决方法:
chown-Rmysql.mysql su-mysql -bash-4.1$(ctrl+d) scripts/mysql.install_db/home/mysql/bin/mysql_safe--user=mysql&/etc/rc.d/init.d/mysqldstatus /etc/rc.d/init.d/mysqldstart
以上所述是小编给大家介绍的Mysql5.6.24安装实例教程,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!