热门标签 | HotTags
当前位置:  开发笔记 > 后端 > 正文

OpenSUSE12.2MySQL5.6数据库安装配置_MySQL

OpenSUSE12.2MySQL5.6数据库安装配置
bitsCN.com

Open SUSE12.2 MySQL5.6数据库安装配置

系统环境:Open SUSE12.2 x86_64

一、下载"SuSE Linux Enterprise Server 11 (x86, 64-bit), RPM Bundle" 或者"SuSE Linux Enterprise Server 11 (x86, 64-bit), RPM Package Client Utilities"、"SuSE Linux Enterprise Server 11 (x86, 64-bit), RPM PackageMySQL Server",地址:https://dev.mysql.com/downloads/mysql/

二、因为在新安装完的SUSE 12.2系统中,原本已有MySQL5.5.25a版本的MySQL,建议清除(本次安装是已清除原有Mysql5.5.25版本后的安装过程),不过也可以在安装过程中覆盖它。按照MySQL官网文档叙述,如果需要在本地登录,则需安同时装MySQL-server和MySQL-client:

rpm -ivh MySQL-server-5.6.13-1.sles11.x86_64.rpm

rpm -ivh MySQL-client-5.6.13-1.sles11.x86_64.rpm

三、安装完成后,你可以在目录/usr下找到my.cnf,不过这个my.cnf没什么内容,下面配置一下my.cnf,该配置仅作参考使用。

[plain] # The following options will be passed to all MySQL clients  [client]  #password   = your_password  port        = 3306  socket      = /opt/mysql/mysql.sock   # Here follows entries for some specific programs  # The MySQL server  [mysqld]  port        = 3306  socket      = /opt/mysql/mysql.sock  # Change following line if you want to store your database elsewhere  basedir=/usr  datadir = /opt/mysql  skip-external-locking  key_buffer_size = 16M  max_allowed_packet = 1M  table_open_cache = 64  sort_buffer_size = 512K  net_buffer_length = 8K  read_buffer_size = 256K  read_rnd_buffer_size = 512K  myisam_sort_buffer_size = 8M  lower_case_table_names=1  


# 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 replication  log-bin=mysql-bin  # binary logging format - mixed recommended  binlog_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 omitted  server-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 = /opt/mysql  innodb_data_file_path = ibdata1:10M:autoextend  innodb_log_group_home_dir = /opt/mysql  # You can set .._buffer_pool_size up to 50 - 80 %  # of RAM but beware of setting memory usage too high  innodb_buffer_pool_size = 16M  #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 = 50  # The safe_mysqld script  [safe_mysqld]  log-error   = /var/log/mysql/mysqld.log  socket      = /opt/mysql/mysql.sock  [mysqldump]  socket      = /opt/mysql/mysql.sock  quick  max_allowed_packet = 16M  [mysql]  no-auto-rehash  # Remove the next comment character if you are not familiar with SQL  #safe-updates  [myisamchk]  key_buffer_size = 20M  sort_buffer_size = 20M  read_buffer = 2M  write_buffer = 2M  [mysqlhotcopy]  interactive-timeout  [mysqld_multi]  mysqld     = /usr/bin/mysqld_safe  mysqladmin = /usr/bin/mysqladmin  log        = /var/log/mysqld_multi.log

四、从给出的配置文件可以看到几个信息与默认的不一样

1、basedir路径的配置

2、datadir路径的配置

3、[client] socket路径的配置

4、[mysqld] socket路径的配置

5、[safe_mysqld] socket路径的配置

6、[mysqldump] socket路径的配置

由于datadir路径配置为“/opt/mysql”,则需要把默认路径"/var/lib"下整个"mysql"文件夹复制到"/opt"下。以下是需要特别注意的地方:先查看一下"/var/lib"下"mysql"的权限和所有者;发现该文件夹的所有者为mysql。再查看"/opt"下刚才复制的"mysql"文件夹所有者,发现该所有者是root,此时如果启动mysql服务,会报错误:StartingMySQL.The server quit without updating PID file。修改"/opt"目录下的"mysql"文件夹所有者:

/opt>chown -R mysql:mysql mysql

注意:[client] socket路径的配置、[mysqld] socket路径的配置、[safe_mysqld] socket路径的配置、[mysqldump] socket路径的配置,都是配置在"/opt/mysql"下。否则会报没有找到mysql.sock错误。

启动mysql服务:service mysql start

查看mysql服务状态:service mysql status

发现一切正常,利用安装时随机生成的root密码(在`/.mysql_secret中)登陆,修改root密码或添加新用户。

bitsCN.com
推荐阅读
  • Skywalking系列博客1安装单机版 Skywalking的快速安装方法
    本文介绍了如何快速安装单机版的Skywalking,包括下载、环境需求和端口检查等步骤。同时提供了百度盘下载地址和查询端口是否被占用的命令。 ... [详细]
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • 本文介绍了在Hibernate配置lazy=false时无法加载数据的问题,通过采用OpenSessionInView模式和修改数据库服务器版本解决了该问题。详细描述了问题的出现和解决过程,包括运行环境和数据库的配置信息。 ... [详细]
  • Metasploit攻击渗透实践
    本文介绍了Metasploit攻击渗透实践的内容和要求,包括主动攻击、针对浏览器和客户端的攻击,以及成功应用辅助模块的实践过程。其中涉及使用Hydra在不知道密码的情况下攻击metsploit2靶机获取密码,以及攻击浏览器中的tomcat服务的具体步骤。同时还讲解了爆破密码的方法和设置攻击目标主机的相关参数。 ... [详细]
  • 在说Hibernate映射前,我们先来了解下对象关系映射ORM。ORM的实现思想就是将关系数据库中表的数据映射成对象,以对象的形式展现。这样开发人员就可以把对数据库的操作转化为对 ... [详细]
  • Linuxchmod目录权限命令图文详解在Linux文件系统模型中,每个文件都有一组9个权限位用来控制谁能够读写和执行该文件的内容。对于目录来说,执行位的作用是控制能否进入或者通过 ... [详细]
  • 在Docker中,将主机目录挂载到容器中作为volume使用时,常常会遇到文件权限问题。这是因为容器内外的UID不同所导致的。本文介绍了解决这个问题的方法,包括使用gosu和suexec工具以及在Dockerfile中配置volume的权限。通过这些方法,可以避免在使用Docker时出现无写权限的情况。 ... [详细]
  • 本文介绍了如何在MySQL中将零值替换为先前的非零值的方法,包括使用内联查询和更新查询。同时还提供了选择正确值的方法。 ... [详细]
  • 本文介绍了数据库的存储结构及其重要性,强调了关系数据库范例中将逻辑存储与物理存储分开的必要性。通过逻辑结构和物理结构的分离,可以实现对物理存储的重新组织和数据库的迁移,而应用程序不会察觉到任何更改。文章还展示了Oracle数据库的逻辑结构和物理结构,并介绍了表空间的概念和作用。 ... [详细]
  • 在数据分析工作中,我们通常会遇到这样的问题,一个业务部门由若干业务组构成,需要筛选出每个业务组里业绩前N名的业务员。这其实是一个分组排序的 ... [详细]
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • 本文介绍了使用postman进行接口测试的方法,以测试用户管理模块为例。首先需要下载并安装postman,然后创建基本的请求并填写用户名密码进行登录测试。接下来可以进行用户查询和新增的测试。在新增时,可以进行异常测试,包括用户名超长和输入特殊字符的情况。通过测试发现后台没有对参数长度和特殊字符进行检查和过滤。 ... [详细]
  • 使用Ubuntu中的Python获取浏览器历史记录原文: ... [详细]
  • 本文详细介绍了Linux中进程控制块PCBtask_struct结构体的结构和作用,包括进程状态、进程号、待处理信号、进程地址空间、调度标志、锁深度、基本时间片、调度策略以及内存管理信息等方面的内容。阅读本文可以更加深入地了解Linux进程管理的原理和机制。 ... [详细]
  • Java String与StringBuffer的区别及其应用场景
    本文主要介绍了Java中String和StringBuffer的区别,String是不可变的,而StringBuffer是可变的。StringBuffer在进行字符串处理时不生成新的对象,内存使用上要优于String类。因此,在需要频繁对字符串进行修改的情况下,使用StringBuffer更加适合。同时,文章还介绍了String和StringBuffer的应用场景。 ... [详细]
author-avatar
手浪用户2602898067
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有