[Linux基础环境/软件]Linux下安装mysql
- 解压和建立软链;
- 配置文件和配置参数;
- 初始化数据库;
- 启动和关闭;
- 建立数据库用户和授权。
#tar xzvf mysql-5.5.28-linux2.6-x86_64.tar.gz #在/usr/local目录下 #ln -s mysql-5.5.28-linux2.6-x86_64 mysql #创建软链
#cp usr/local/mysql/support-files/my-medium.cnf etc/my.cnf
[client]
default-character-set = utf8
# password = your_passsword
port = 3306
socket = /tmp/mysql_3306.sock
# The MySQL server
[mysqld]
character-set-server = utf8
# user = mysql
port = 3306
socket = /tmp/mysql_3306.sock
skip-external-locking
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
log-error = /usr/local/mysql/log/mysql_error.log
pid-file = /tmp/mysql.pid
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
#./mysql_install_db --verbose --user=root --defaults-file=/etc/my.cnf --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql --tmpdir=/tmp
#./mysqld_safe --defaults-file=/etc/my.cnf --socket=/tmp/mysql_3306.sock --user=root &
#./mysqladmin -u root -p [密码] shutdown
#./mysql -uroot
mysql>CREATE USER [用户名] IDENTIFIED BY ‘[密码]‘; mysql>CREATE USER [用户名]@[固定登录地址(譬如localhost)] IDENTIFIED BY ‘[密码]‘
mysql>GRANT select, insert, update, delete, create ON *.* TO [用户名]; mysql>GRANT select, insert, update, delete, create ON *.* TO [用户名]@[固定登录地址(譬如localhost)];
mysql>GRANT ALL PRIVILEGES ON PUREFTPD.* TO [用户名] IDENTIFIED BY ‘[新密码]‘;
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。