做网站哪家公司比较好而且不贵,东莞核酸检测时间,seo推广优化公司,摄影展板设计MySQL源码编译与初始化 链接#xff1a;https://pan.baidu.com/s/1ANGg3Kd_28BzQrA5ya17fQ 提取码#xff1a;ekpy 复制这段内容后打开百度网盘手机App#xff0c;操作更方便哦 1.MySQL简介 1.1数据库有很多种类#xff1a; 关系型数据库---MySQL Oracle非关系型数据库…MySQL源码编译与初始化 链接https://pan.baidu.com/s/1ANGg3Kd_28BzQrA5ya17fQ 提取码ekpy 复制这段内容后打开百度网盘手机App操作更方便哦 1.MySQL简介 1.1数据库有很多种类 关系型数据库---MySQL Oracle非关系型数据库--memcached redis图形化数据库----mongodb阵列型线形数据库---Hbase时间序列数据库----influxDB 1.2什么叫关系型数据库 SQL数据库数据与数据之间是有关系的通过关系能够将一系列数据都提取出来。 1.3什么叫非关系型数据库 NOSQLNot only SQL)数据库 2.安装源码编译必备的几个软件包 [rootyangwenbo yang]# yum -y install make gcc gcc-c ncurses-devel cmake
[rootyangwenbo yang]# rpm -qa make gcc gcc-c ncurses-devel cmake
gcc-4.4.7-4.el6.x86_64
cmake-2.6.4-5.el6.x86_64
gcc-c-4.4.7-4.el6.x86_64
ncurses-devel-5.7-3.20090208.el6.x86_64
make-3.81-20.el6.x86_64 3.源码编译与安装 3.1源码编译cmake-2.8.6.tar.gz [rootyangwenbo yang]# ls
cmake-2.8.6.tar.gz mysql-5.5.22.tar.gz 3.1.1解包 [rootyangwenbo yang]# tar xf cmake-2.8.6.tar.gz -C /usr/src/ 3.1.2去解包后的文件存放位置的目录 [rootyangwenbo yang]# cd /usr/src/cmake-2.8.6/ 3.1.3编译安装 [rootyangwenbo cmake-2.8.6]# ./configure gmake gmake install
#以下省略。。。 耐心等待...3.1.4编译成功 [rootMysql cmake-2.8.6]# echo $?
0 3.2源码编译mysql-5.5.22.tar.gz [rootyangwenbo yang]# ls
cmake-2.8.6.tar.gz mysql-5.5.22.tar.gz 3.2.1创建程序用户 [rootyangwenbo yang]# useradd -s /sbin/nologin -M mysql
[rootyangwenbo yang]# id mysql
uid500(mysql) gid500(mysql) groups500(mysql) 3.2.2解包 [rootyangwenbo yang]# tar xf mysql-5.5.22.tar.gz -C /usr/src/ 3.2.3去解包后的文件存放位置的目录 [rootyangwenbo yang]# cd /usr/src/mysql-5.5.22/ 3.2.4编译安装 [rootyangwenbo mysql-5.5.22]# cmake -DCMAKE_INSTALL_PREFIX/usr/local/mysql -DSYSCONFDIR/etc -DDEFAULT_CHARSETutf8 -DDEFAULT_COLLATIONutf8_general_ci -DWITH_EXTRA_CHARSETSall make make install
#以下省略。。。 3.2.5编译成功 [rootMysql mysql-5.5.22]# echo $?
0 3.2.6目录简介 4.安装后优化操作 4.1修改mysql安装目录的属主 [rootMysql /]# chown -R mysql /usr/local/mysql/
[rootMysql /]# ll -d /usr/local/mysql/
drwxr-xr-x. 13 mysql root 4096 Aug 19 00:19 /usr/local/mysql/ 4.2创建修改my.cnf配置文件 [rootMysql mysql]# /bin/cp support-files/my-medium.cnf /etc/my.cnf 4.3创建修改mysqld的启动脚本 [rootMysql mysql]# /bin/cp support-files/mysql.server /etc/init.d/mysqld 4.4为启动脚本加上X权限 [rootMysql mysql]# chmod x /etc/init.d/mysqld
[rootMysql mysql]# ll -d /etc/init.d/mysqld
-rwxr-xr-x. 1 root root 10650 Aug 19 01:08 /etc/init.d/mysqld 4.5添加至系统服务(开机自启动 [rootMysql mysql]# chkconfig mysqld --add
[rootMysql mysql]# chkconfig mysqld --list
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off 4.6.1使用软连接使环境变量找到这个命令 [rootMysql mysql]# which mysql #一开始找不到这个命令
/usr/bin/which: no mysql in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[rootMysql mysql]# ln -s /usr/local/mysql/bin/* /usr/local/bin/
[rootMysql mysql]# which mysql #通过软连接已经可以找到这个命令
/usr/local/bin/mysql 4.6.2使用环境变量 4.7执行mysql_install_db脚本初始化数据库 [rootMysql mysql]# /usr/local/mysql/scripts/mysql_install_db --usermysql --basedir/usr/local/mysql/ --datadir/usr/local/mysql/data/
#以下省略。。。 4.8启动mysql服务并查看运行状态 [rootMysql mysql]# /etc/init.d/mysqld start
Starting MySQL... SUCCESS!
[rootMysql mysql]# netstat -anpt | grep :3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 40589/mysqld 5.登录MySQL 5.1进入 5.2MySQL参数 5.3为MySQL设置密码 [rootMysql mysql]# mysqladmin -uroot password 971108 5.4用户登录 不交互登录 [rootMysql mysql]# mysql -uroot -p971108
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.22-log Source distributionCopyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type help; or \h for help. Type \c to clear the current input statement.mysql
#登录成功配置完成 6.误删tmp目录下的文件 6.1已知误删tmp目录下的文件 6.2修改MySQL配置文件 6.3重启MySQL 6.4查看 转载于:https://www.cnblogs.com/ywb123/p/11198943.html