网站对应的ip地址吗,wordpress查询分页,免费设计房屋效果图软件有哪些,国外网站建站MySQL的源码编译安装#xff1a;
1、参考MySQL的源码安装官方文档#xff1a; 2、源码安装定制选项#xff1a; 3、源码安装三部曲#xff1a;配置、编译、安装。 4、软件安装包#xff1a;
mysql-boost-5.7.43.tar.gz 5、安装需求#xff1a;
安装需求具体配置安装目…MySQL的源码编译安装
1、参考MySQL的源码安装官方文档 2、源码安装定制选项 3、源码安装三部曲配置、编译、安装。 4、软件安装包
mysql-boost-5.7.43.tar.gz 5、安装需求
安装需求具体配置安装目录basedir/mysql_3307数据目录datadir/mysql_3307/data端口号3307socket文件位置$basedir/mysql.sock字符集utf8mb4
主要安装目录、端口和socket套接字不一样就可以在一台服务器上安装两个mysql。 6、了解配置选项
源码安装可定制性比较强。 其中collation 核对、校验的意思。 ENABLED_LOCAL_INFILE外部数据导入的时候需要开启该功能。 安装步骤
1安装依赖包
[rootmysql-server ~]# yum -y install ncurses-devel cmake libaio-devel openssl-devel2上传mysql源码包并解压
这个时候做一个拍照。
[rootmysql-server ~]# tar -zxvf mysql-boost-5.7.43.tar.gz 3进入到解压目录里配置
[rootmysql-server ~]# cd mysql-5.7.43 4编写脚本进行配置 vim myconfig.sh
cmake . \
-DCMAKE_INSTALL_PREFIX/mysql_3307 \
-DMYSQL_DATADIR/mysql_3307/data \
-DMYSQL_TCP_PORT3307 \
-DMYSQL_UNIX_ADDR/mysql_3307/mysql.sock \
-DWITH_INNOBASE_STORAGE_ENGINE1 \
-DWITH_PARTITION_STORAGE_ENGINE1 \
-DWITH_FEDERATED_STORAGE_ENGINE1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE1 \
-DWITH_MYISAM_STORAGE_ENGINE1 \
-DENABLED_LOCAL_INFILE1 \
-DEXTRA_CHARSETSall \
-DDEFAULT_CHARSETutf8mb4 \
-DDEFAULT_COLLATIONutf8mb4_general_ci \
-DWITH_SSLsystem \
-DWITH_BOOST/mysql_3307/boost \
-DDOWNLOAD_BOOST1
说明在这个配置里如果还需要安装别的数据库只要修改几个地方 -DCMAKE_INSTALL_PREFIX
-DMYSQL_DATADIR
-DMYSQL_TCP_PORT
-DMYSQL_UNIX_ADDR 5添加脚本执行权限然后执行脚本。
[rootmysql-server mysql-5.7.43]# chmod x mysqlconfig.sh
[rootmysql-server mysql-5.7.43]# ./mysqlconfig.sh这个过程是一个配置的过程。 6编译和安装
make make install 也可以写成
make -j2 make install
选项
-j2代表同时开启多个线程共同实现编译操作。 MySQL数据库的初始化工作
1进入到/mysql_3307
[rootmysql-server mysql-5.7.43]# cd /mysql_3307
[rootmysql-server mysql_3307]# pwd
/mysql_33072创建mysql-files目录
[rootmysql-server mysql_3307]# mkdir mysql-files
[rootmysql-server mysql_3307]# chown mysql:mysql mysql-files
[rootmysql-server mysql_3307]# chmod 750 mysql-files3初始化数据库
[rootmysql-server mysql_3307]# bin/mysqld --initialize --usermysql --basedir/mysql_3307 --datadir/mysql_3307/data
2023-09-22T16:03:38.325762Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-09-22T16:03:38.507868Z 0 [Warning] InnoDB: New log files created, LSN45790
2023-09-22T16:03:38.532672Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-09-22T16:03:38.586904Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 97a3f645-5961-11ee-8c2b-000c295cf01e.
2023-09-22T16:03:38.587416Z 0 [Warning] Gtid table is not ready to be used. Table mysql.gtid_executed cannot be opened.
2023-09-22T16:03:38.703329Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-09-22T16:03:38.703383Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-09-22T16:03:38.703732Z 0 [Warning] CA certificate ca.pem is self signed.
2023-09-22T16:03:38.736069Z 1 [Note] A temporary password is generated for rootlocalhost: _uhi%b?us9Qr里面创建了data目录data目录里面有mysql目录。 4启动数据库
[rootmysql-server mysql_3307]# cp support-files/mysql.server /etc/init.d/mysql_3307
[rootmysql-server mysql_3307]# service mysql_3307 start常见启动异常的解决方案 查看日志 解决办法很多问题跟权限有关要理解权限、拥有者、所属组。
[rootmysql-server /]# chown -R mysql:mysql mysql_3307也可以使用chmod命令更改权限如果该了权限可能不符合权限最小化的原则。 安装完后续配置
[rootmysql-server mysql_3307]# cat my.cnf
[mysqld]
basedir/mysql_3307
datadir/mysql_3307/data
socket/mysql_3307/mysql.sock[rootmysql-server mysql_3307]# service mysql_3307 restart
Shutting down MySQL.. SUCCESS!
Starting MySQL. SUCCESS!别忘了要将mysql_3307重启。 设置数据库管理root的密码
bin/mysqladmin -uroot password 1q2w3e4r -p 安全设置
[rootmysql-server mysql_3307]# bin/mysql_secure_installationSecuring the MySQL server deployment.Enter password for user root:VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?Press y|Y for Yes, any other key for No: n
Using existing password for root.
Change the password for root ? ((Press y|Y for Yes, any other key for No) : n... skipping.
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.Normally, root should only be allowed to connect from
localhost. This ensures that someone cannot guess at
the root password from the network.Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.By default, MySQL comes with a database named test that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y- Dropping test database...
Success.- Removing privileges on test database...
Success.Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.All done!添加mysql_3307的开机启动项
[rootmysql-server ~]# chkconfig --add mysql_3307
[rootmysql-server ~]# chkconfig mysql_3307 on
[rootmysql-server ~]#
[rootmysql-server ~]# chkconfig --listNote: This output shows SysV services only and does not include nativesystemd services. SysV configuration data might be overridden by nativesystemd configuration.If you want to list systemd services use systemctl list-unit-files.To see services enabled on particular target usesystemctl list-dependencies [target].mysql_3306 0:off 1:off 2:on 3:on 4:on 5:on 6:off
mysql_3307 0:off 1:off 2:on 3:on 4:on 5:on 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:offmysql常见问题解决方案
1、如何访问不同的数据库
方法一直接使用对应的客户端软件访问
访问5.7.31版本数据库
[rootnode1 ~]# /mysql_3306/bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.31 MySQL Community Server (GPL)访问5.7.31版本数据库
[rootnode1 ~]# /mysql_3307/bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.31 Source distribution
方法二定义别名的方式访问
[rootnode1 ~]# alias mysql_3306/mysql_3306/bin/mysql
[rootnode1 ~]# alias mysql_3307/mysql_3307/bin/mysql
[rootnode1 ~]# mysql_3306 -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.31 MySQL Community Server (GPL)[rootnode1 ~]# mysql_3307 -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.7.31 Source distribution
方法三拷贝相应命令到PATH可以识别的路径下并重命名
[rootnode1 ~]# unalias mysql_3306
[rootnode1 ~]# unalias mysql_3307
我是华丽分隔符
[rootnode1 ~]# cp /mysql_3306/bin/mysql /usr/bin/mysql_3306
[rootnode1 ~]# cp /mysql_3307/bin/mysql /usr/bin/mysql_3307
[rootnode1 ~]# which mysql_3306
/usr/bin/mysql_3306
[rootnode1 ~]# which mysql_3307
/usr/bin/mysql_3307
我个人感觉还是倾向于第三种方法。 思考我们之所以能够连接到数据库服务器的本质就是套接字。 MySQL密码忘记了如何解决
这个需要按照老师的步骤进行下联系。 [rootmysql-server ~]# ps aux |grep mysql
root 934 0.0 0.0 115544 1708 ? S 13:08 0:00 /bin/sh /mysql_3307/bin/mysqld_safe --datadir/mysql_3307/data --pid-file/mysql_3307/data/mysql-server.lnmp.com.pid
mysql 1213 0.1 9.0 1144064 183968 ? Sl 13:08 0:00 /mysql_3307/bin/mysqld --basedir/mysql_3307 --datadir/mysql_3307/data --plugin-dir/mysql_3307/lib/plugin --usermysql --log-errormysql-server.lnmp.com.err --pid-file/mysql_3307/data/mysql-server.lnmp.com.pid --socket/mysql_3307/mysql.sock
root 1621 0.0 0.0 11824 1592 pts/0 S 13:13 0:00 /bin/sh /mysql_3306/bin/mysqld_safe --datadir/mysql_3306/data --pid-file/mysql_3306/data/mysql-server.lnmp.com.pid
mysql 1750 0.2 8.9 1121060 180816 pts/0 Sl 13:13 0:00 /mysql_3306/bin/mysqld --basedir/mysql_3306 --datadir/mysql_3306/data --plugin-dir/mysql_3306/lib/plugin --usermysql --log-errormysql-server.lnmp.com.err --pid-file/mysql_3306/data/mysql-server.lnmp.com.pid --socket/tmp/mysql.sock
root 1887 0.0 0.0 112812 972 pts/0 S 13:14 0:00 grep --colorauto mysql
[rootmysql-server ~]# service mysql_3306 restart
Shutting down MySQL.. SUCCESS!
Starting MySQL. SUCCESS!
[rootmysql-server ~]# service mysql_3307 restart
Shutting down MySQL.. SUCCESS!
Starting MySQL. SUCCESS!mysqladmin工具的使用
关闭数据库
[rootnode1 ~]# mysqladmin shutdown -p
默认修改数据库管理员root密码
[rootnode1 ~]# mysqladmin password newpass -p
[rootnode1 ~]# mysqladmin password 123 -uroot -h localhost -p查看扩展信息比如变量
[rootnode1 ~]# mysqladmin proc extended-status -p
创建数据库
[rootnode1 ~]# mysqladmin create db01 -p
删除数据库
[rootnode1 ~]# mysqladmin drop db01 -p
文章转载自: http://www.morning.szoptic.com.gov.cn.szoptic.com http://www.morning.qmnhw.cn.gov.cn.qmnhw.cn http://www.morning.bqyb.cn.gov.cn.bqyb.cn http://www.morning.qpxrr.cn.gov.cn.qpxrr.cn http://www.morning.kpcky.cn.gov.cn.kpcky.cn http://www.morning.rhkq.cn.gov.cn.rhkq.cn http://www.morning.ryjqh.cn.gov.cn.ryjqh.cn http://www.morning.kmjbs.cn.gov.cn.kmjbs.cn http://www.morning.wrbf.cn.gov.cn.wrbf.cn http://www.morning.wjrtg.cn.gov.cn.wjrtg.cn http://www.morning.wsnjn.cn.gov.cn.wsnjn.cn http://www.morning.hlnys.cn.gov.cn.hlnys.cn http://www.morning.hpkr.cn.gov.cn.hpkr.cn http://www.morning.mxdiy.com.gov.cn.mxdiy.com http://www.morning.rwxnn.cn.gov.cn.rwxnn.cn http://www.morning.hbkkc.cn.gov.cn.hbkkc.cn http://www.morning.kkrnm.cn.gov.cn.kkrnm.cn http://www.morning.wrlcy.cn.gov.cn.wrlcy.cn http://www.morning.xnflx.cn.gov.cn.xnflx.cn http://www.morning.lqlfj.cn.gov.cn.lqlfj.cn http://www.morning.ywpwq.cn.gov.cn.ywpwq.cn http://www.morning.ftsmg.com.gov.cn.ftsmg.com http://www.morning.dxqwm.cn.gov.cn.dxqwm.cn http://www.morning.ktrdc.cn.gov.cn.ktrdc.cn http://www.morning.thntp.cn.gov.cn.thntp.cn http://www.morning.qhmhz.cn.gov.cn.qhmhz.cn http://www.morning.lsnhs.cn.gov.cn.lsnhs.cn http://www.morning.pgmbl.cn.gov.cn.pgmbl.cn http://www.morning.rycbz.cn.gov.cn.rycbz.cn http://www.morning.cmzcp.cn.gov.cn.cmzcp.cn http://www.morning.rxwnc.cn.gov.cn.rxwnc.cn http://www.morning.xkbdx.cn.gov.cn.xkbdx.cn http://www.morning.jbxfm.cn.gov.cn.jbxfm.cn http://www.morning.bangaw.cn.gov.cn.bangaw.cn http://www.morning.xrwsg.cn.gov.cn.xrwsg.cn http://www.morning.zrdqz.cn.gov.cn.zrdqz.cn http://www.morning.fhtbk.cn.gov.cn.fhtbk.cn http://www.morning.jydhl.cn.gov.cn.jydhl.cn http://www.morning.drnfc.cn.gov.cn.drnfc.cn http://www.morning.ttryd.cn.gov.cn.ttryd.cn http://www.morning.fbpyd.cn.gov.cn.fbpyd.cn http://www.morning.swimstaracademy.cn.gov.cn.swimstaracademy.cn http://www.morning.sgfgz.cn.gov.cn.sgfgz.cn http://www.morning.kpgms.cn.gov.cn.kpgms.cn http://www.morning.fpyll.cn.gov.cn.fpyll.cn http://www.morning.nrjr.cn.gov.cn.nrjr.cn http://www.morning.wlbwp.cn.gov.cn.wlbwp.cn http://www.morning.kxbdm.cn.gov.cn.kxbdm.cn http://www.morning.hjrjy.cn.gov.cn.hjrjy.cn http://www.morning.crsqs.cn.gov.cn.crsqs.cn http://www.morning.rqlqd.cn.gov.cn.rqlqd.cn http://www.morning.yrycb.cn.gov.cn.yrycb.cn http://www.morning.ltqzq.cn.gov.cn.ltqzq.cn http://www.morning.dytqf.cn.gov.cn.dytqf.cn http://www.morning.cdygl.com.gov.cn.cdygl.com http://www.morning.wyfpc.cn.gov.cn.wyfpc.cn http://www.morning.tyhfz.cn.gov.cn.tyhfz.cn http://www.morning.lyrgp.cn.gov.cn.lyrgp.cn http://www.morning.bdqpl.cn.gov.cn.bdqpl.cn http://www.morning.qpzjh.cn.gov.cn.qpzjh.cn http://www.morning.bwygy.cn.gov.cn.bwygy.cn http://www.morning.rdgb.cn.gov.cn.rdgb.cn http://www.morning.wcgcm.cn.gov.cn.wcgcm.cn http://www.morning.bmpjp.cn.gov.cn.bmpjp.cn http://www.morning.nxfuke.com.gov.cn.nxfuke.com http://www.morning.bqxxq.cn.gov.cn.bqxxq.cn http://www.morning.dwzwm.cn.gov.cn.dwzwm.cn http://www.morning.zpstm.cn.gov.cn.zpstm.cn http://www.morning.hlzpb.cn.gov.cn.hlzpb.cn http://www.morning.zfzgp.cn.gov.cn.zfzgp.cn http://www.morning.hclplus.com.gov.cn.hclplus.com http://www.morning.mmclj.cn.gov.cn.mmclj.cn http://www.morning.btwlp.cn.gov.cn.btwlp.cn http://www.morning.xqxlb.cn.gov.cn.xqxlb.cn http://www.morning.czcbl.cn.gov.cn.czcbl.cn http://www.morning.nyqnk.cn.gov.cn.nyqnk.cn http://www.morning.wnbpm.cn.gov.cn.wnbpm.cn http://www.morning.mtjwp.cn.gov.cn.mtjwp.cn http://www.morning.grryh.cn.gov.cn.grryh.cn http://www.morning.rdqzl.cn.gov.cn.rdqzl.cn