千家信息网

利用单实例二进制方式对SuSE11系统MySQL5.7.22进行安装

发表于:2025-01-20 作者:千家信息网编辑
千家信息网最后更新 2025年01月20日,本文主要给大家简单讲讲利用单实例二进制方式对SuSE11系统MySQL5.7.22进行安装,相关专业术语大家可以上网查查或者找一些相关书籍补充一下,这里就不涉猎了,我们就直奔主题吧,希望利用单实例二进
千家信息网最后更新 2025年01月20日利用单实例二进制方式对SuSE11系统MySQL5.7.22进行安装

本文主要给大家简单讲讲利用单实例二进制方式对SuSE11系统MySQL5.7.22进行安装,相关专业术语大家可以上网查查或者找一些相关书籍补充一下,这里就不涉猎了,我们就直奔主题吧,希望利用单实例二进制方式对SuSE11系统MySQL5.7.22进行安装这篇文章可以给大家带来一些实际帮助。

一、环境准备

操作系统:SuSE版本11sp3,64位

kingtry:~ # uname -aLinux kingtry 3.0.76-0.11-default #1 SMP Fri Jun 14 08:21:43 UTC 2013 (ccab990) x86_64 x86_64 x86_64 GNU/Linuxkingtry:~ # cat /etc/SuSE-release SUSE Linux Enterprise Server 11 (x86_64)VERSION = 11PATCHLEVEL = 3

二、依赖包

tack-5.6-90.55.x86_64.rpm

ncurses-devel-5.6-90.55.x86_64.rpm

安装好上面两个依赖包之后,创建连接文件:

kingtry:~ # ln -s /usr/lib64/libncurses.so /usr/lib64/libtinfo.so.5

注:如果上面连接文件没有创建,则客户端连接mysql服务的时候会报如下异常信息:

error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

三、软件准备

mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz

四、安装过程

1、创建群组及用户

kingtry:~ # groupadd mysqlkingtry:~ # useradd -g mysql mysql

2、创建相关目录

kingtry:~ # mkdir -p /data/mysql/{data,tmp}       #创建存放数据文件目录,data与tmp之间不能为空格kingtry:~ # chown -R mysql.mysql /data/mysql

3、解压文件,并修改解压后的文件夹的名称

kingtry:~ # tar -xf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gzkingtry:~ # mv mysql-5.7.22-linux-glibc2.12-x86_64 mysql-5.7.22

4、配置环境变量

kingtry:~ # echo 'PATH=/root/mysql-5.7.22/bin:$PATH' >> /etc/profilekingtry:~ # source /etc/profile

5、初始化数据库

kingtry:~ # mysqld --initialize --basedir=/root/mysql-5.7.22 --datadir=/data/mysql/data --user=mysql2018-06-20T10:05:47.174970Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2018-06-20T10:05:47.721858Z 0 [Warning] InnoDB: New log files created, LSN=457902018-06-20T10:05:47.801079Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.2018-06-20T10:05:47.856829Z 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: 80f68c90-7471-11e8-b25a-000c29472b4a.2018-06-20T10:05:47.859008Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2018-06-20T10:05:47.860232Z 1 [Note] A temporary password is generated for root@localhost: OAihgPk420(l

注:最后一行显示生成的root用户的默认密码

五、创建配置文件/data/mysql/my.cnf

该版本默认没有配置文件的模板,需要手工创建

my.cnf内容参考如下:

# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html [client]#password = your_passwordport = 3306socket = /data/mysql/mysql.sockdefault-character-set=utf8# Here follows entries for some specific programs# The MySQL server[mysqld]port = 3306datadir = /data/mysql/datatmpdir = /data/mysql/tmpsocket = /data/mysql/mysql.sockcharacter-set-server = utf8collation-server = utf8_general_cipid-file = /data/mysql/mysql.piduser = mysql  explicit_defaults_for_timestamplower_case_table_names = 1max_connections = 1000back_log = 1024open_files_limit = 10240table_open_cache = 5120  #bind-address = 127.0.0.1  #skip-name-resolveskip-external-lockinglocal-infile = 1  key_buffer_size = 32Mmax_allowed_packet = 1Mtable_open_cache = 64sort_buffer_size = 512Knet_buffer_length = 8Kread_buffer_size = 256Kread_rnd_buffer_size = 512Kmyisam_sort_buffer_size = 8M  # Don't listen on a TCP/IP port at all. This can be a security enhancement,# if all processes that need to connect to mysqld run on the same host.# All interaction with mysqld must be made via Unix sockets or named pipes.# Note that using this option without enabling named pipes on Windows# (via the "enable-named-pipe" option) will render mysqld useless!# #skip-networking  # Replication Master Server (default)# binary logging is required for replicationlog-bin = /data/mysql/mysql-bin  # binary logging format - mixed recommendedbinlog_format = mixed  # required unique id between 1 and 2^32 - 1# defaults to 1 if master-host is not set# but will not function as a master if omittedserver-id = 1  # Replication Slave (comment out master section to use this)## To configure this host as a replication slave, you can choose between# two methods :## 1) Use the CHANGE MASTER TO command (fully described in our manual) -#    the syntax is:##    CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=,#    MASTER_USER=, MASTER_PASSWORD= ;##    where you replace , ,  by quoted strings and#     by the master's port number (3306 by default).##    Example:##    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,#    MASTER_USER='joe', MASTER_PASSWORD='secret';## OR## 2) Set the variables below. However, in case you choose this method, then#    start replication for the first time (even unsuccessfully, for example#    if you mistyped the password in master-password and the slave fails to#    connect), the slave will create a master.info file, and any later#    change in this file to the variables' values below will be ignored and#    overridden by the content of the master.info file, unless you shutdown#    the slave server, delete master.info and restart the slaver server.#    For that reason, you may want to leave the lines below untouched#    (commented) and instead use CHANGE MASTER TO (see above)## required unique id between 2 and 2^32 - 1# (and different from the master)# defaults to 2 if master-host is set# but will not function as a slave if omitted#server-id       = 2## The replication master for this slave - required#master-host     =   ## The username the slave will use for authentication when connecting# to the master - required#master-user     =   ## The password the slave will authenticate with when connecting to# the master - required#master-password =   ## The port the master is listening on.# optional - defaults to 3306#master-port     =  ## binary logging - not required for slaves, but recommended#log-bin=mysql-bin  # Uncomment the following if you are using InnoDB tables#innodb_data_home_dir = /var/lib/mysqlinnodb_data_file_path = ibdata1:10M:autoextend#innodb_log_group_home_dir = /var/lib/mysql# You can set .._buffer_pool_size up to 50 - 80 %# of RAM but beware of setting memory usage too highinnodb_buffer_pool_size = 256M#innodb_additional_mem_pool_size = 2M# Set .._log_file_size to 25 % of buffer pool size#innodb_log_file_size = 5M#innodb_log_buffer_size = 8M#innodb_flush_log_at_trx_commit = 1#innodb_lock_wait_timeout = 50innodb_buffer_pool_instances = 2innodb_read_io_threads = 8innodb_write_io_threads = 8innodb_purge_threads = 1  slow_query_log = 1long_query_time = 10log-queries-not-using-indexes  log-error = /data/mysql/mysql.err  expire-logs-days = 10  [mysqldump]quickmax_allowed_packet = 512Mnet_buffer_length = 16384  [mysql]auto-rehash# Remove the next comment character if you are not familiar with SQL#safe-updates  [myisamchk]key_buffer_size = 20Msort_buffer_size = 20Mread_buffer = 2Mwrite_buffer = 2M  [mysqlhotcopy]interactive-timeout

六、启动MySQL服务

kingtry:~ # mysqld --defaults-file=/data/mysql/my.cnf --user=mysql &

七、安装后配置之root密码修改

修改root密码的方式有以下两种,随便哪个都行:

1、shell命令方式

kingtry:~ # mysqladmin -u root -p  password 'root123' -S /data/mysql/mysql.sockEnter password:

2、mysql命令方式

先登陆mysql云服务器

mysql>  set password=password('root123')

八、客户端连接MySQL服务

kingtry:~ # mysql -uroot -p -S /data/mysql/mysql.sock

注:需要指定 -S 参数

九、防火墙允许3306端口

kingtry:~ # vi /etc/sysconfig/SuSEfirewall2

在FW_SERVICES_EXT_TCP增加3306端口,如果存在其他端口,则空格隔开,如:

FW_SERVICES_EXT_TCP="21 22 3306"

重启防火墙:

# rcSuSEfirewall2 restart

十、设置远程访问

先登陆mysql云服务器,授权root用户可以远程登陆

mysql> grant all PRIVILEGES on *.* to root@'%' identified by 'root123'; Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql>

注:生产环境最好只允许root在特定IP的机器上才能远程访问。

利用单实例二进制方式对SuSE11系统MySQL5.7.22进行安装就先给大家讲到这里,对于其它相关问题大家想要了解的可以持续关注我们的行业资讯。我们的板块内容每天都会捕捉一些行业新闻及专业知识分享给大家的。

文件 方式 服务 系统 配置 二进制 实例 密码 环境 用户 端口 登陆 专业 内容 命令 客户 客户端 数据 服务器 版本 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 微信服务器保存几天数据 应用层软件开发工程师前景 松江区定制软件开发推荐咨询 服务器电源网络 交个朋友武汉互联网科技有限公司 华为的软件开发人员是谁 任我行应用服务器 玫瑰互联网金融科技公司 河北智能软件开发需要多少钱 怎么把程序传到阿里云服务器上面 我的世界基岩版大型服务器存档 大华磁盘阵列与服务器不同步 软件架构在软件开发周期 大连跑腿软件开发 软件开发股票客户违法 在日本无服务器 ncat数据库 高德红外制导控制软件开发 巨之乾网络技术有限公司怎么样 数据库安全管理 大数据 崇明区企业软件开发专业服务 嵌入式软件开发主要干什么 犬夜叉觉醒数据库操作 科技服务包括利用高校数据库 eora数据库是干嘛的 江苏5g服务器小型机柜虚拟主机 莱州微信公众号软件开发哪家靠谱 拆分数据库后端文件的扩展名 公司连上服务器内网不通 数据库软件技术支持
0