opensuse免安装mysql

opensuse系统免安装运行mysql

 1、下载mysql

http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz

 

2、解压文件

tar xzvf mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz

 

3、创建软链

ln -s mysql-5.6.30-linux-glibc2.5-x86_64 mysql 

 

4、配置文件和参数:复制mysql/support-files/my-default.cnf到etc/my.cnf

cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf

 

5、修改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

 

6、初始化数据库:在mysql/bin或者mysql/scripts下有个 mysql_install_db 可执行文件

./mysql_install_db  --verbose --user=root --defaults-file=/etc/my.cnf --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql --tmpdir=/tmp

 

7、启动数据库:bin/

./mysqld_safe --defaults-file=/etc/my.cnf --socket=/tmp/mysql_3306.sock --user=root &

 

8、登录mysql

./mysql -uroot -p

 

9、关闭数据库

./mysqladmin -u root -p [密码] shutdown或者杀死进程

 

上一篇:hdu 5289 Assignment(给一个数组,求有多少个区间,满足区间内的最大值和最小值之差小于k)


下一篇:2021“MINIEYE杯”中国大学生算法设计超级联赛(5)题解