1、rpm -qa | grep mysql //首先检查是否安装了mysql
2、如果安装了,卸载 rpm -e mysql
3\ 下载地址
http://dev.mysql.com/downloads/mysql/
4、
5、groupadd mysql //可以先查看是否存在这个用户组 more /etc/group more /et
c/passwd
6\ useradd -g mysql mysql
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/var/mysql/data \
-DMYSQL_USER=mysql
make
make install
7\ cd scripts/ mysql_install_db 初始化安装好mysql
数据库后的文件
scripts/mysql_install_db --user=mysql
安装中遇到问题
5.5.12mysql安装中
和5.1一样执行
#/usr/local/mysql/scripts/mysql_install_db --user=mysql
出现错误
FATAL ERROR: Could not find ./bin/my_print_defaults
If you compiled from source, you need to run ‘make install‘ to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
解决
/usr/local/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/mnt/mysql --user=mysql
094 |
cp support-files/my-huge.cnf /etc/my.cnf |
101 |
chown mysql:mysql /etc/my.cnf |
102 |
chown -R mysql:mysql /mysql/mysqldir |
108 |
cp scripts/mysql_install_db . |
时间: 2024-10-10 03:19:32