mysql安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql安装相关的知识,希望对你有一定的参考价值。
mysql安装
1.安装相关包
1.1安装cmake软件
cd /root/tools tar xf cmake-2.8.8.tar.gz cd cmake-2.8.8 ./configure gmake gmake install cd ..
1.2安装依赖包
yum install ncurses-devel –y
2.安装mysql
groupadd mysql useradd -s /sbin/nologin -M -g mysql mysql
tar xf mysql-5.5.32.tar.gz cd mysql-5.5.32 cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.5.32 -DMYSQL_DATADIR=/application/mysql-5.5.32/data -DMYSQL_UNIX_ADDR=/application/mysql-5.5.32/tmp/mysql.sock -DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii -DENABLED_LOCAL_INFILE=ON -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 -DWITHOUT_PARTITION_STORAGE_ENGINE=1 -DWITH_FAST_MUTEXES=1 -DWITH_ZLIB=bundled -DENABLED_LOCAL_INFILE=1 -DWITH_READLINE=1 -DWITH_EMBEDDED_SERVER=1 -DWITH_DEBUG=0 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci \
make && make install ln -s /application/mysql-5.5.32/ /application/mysql cp /root/tools/mysql-5.5.32/support-files/my-small.cnf /etc/my.cnf echo ‘export PATH=/application/mysql/bin/:$PATH‘ >>/etc/profile tail -l /etc/profile source /etc/profile echo $PATH chown -R mysql.mysql /application/mysql/data/ cd /application/mysql/scripts/ ./mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql cp /root/tools/mysql-5.5.32/support-files/mysql.server /etc/init.d/mysqld chmod +x /etc/init.d/mysqld /etc/init.d/mysqld start netstat -tulnp |grep 3306 chkconfig mysqld on chkconfig --list |grep mysqld
3.简单优化
mysql select user,host from mysql.user; delete from mysql.user where user=‘‘; delete from mysql.user where host="localhost.localdomain"; delete from mysql.user where host="::1"; drop database test; show databases; quit mysqladmin -uroot password
以上是关于mysql安装的主要内容,如果未能解决你的问题,请参考以下文章
连接MySQL出现错误:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)(代码片段
使用 json rereiver php mysql 在片段中填充列表视图
在Tomcat的安装目录下conf目录下的server.xml文件中增加一个xml代码片段,该代码片段中每个属性的含义与用途
关于mysql驱动版本报错解决,Cause: com.mysql.jdbc.exceptions.jdbc4Unknown system variable ‘query_cache_size(代码片段