In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following mainly brings you how to install MySQL5.5.60 using rpm installation package under SuSE11. I hope these contents can bring you practical use, which is also the main purpose of this article on how to use rpm installation package to install MySQL5.5.60 under SuSE11. All right, don't talk too much nonsense, let's just read the following.
I. Environmental preparation
Operating system: SuSE version 11sp3re64-bit
Kingtry:~ # uname-aLinux kingtry 3.0.76-0.11-default # 1 SMP Fri Jun 14 08:21:43 UTC 2013 (ccab990) x86 "64 x 86" 64 x86 "64 GNU/Linuxkingtry:~ # cat / etc/SuSE-release SUSE Linux Enterprise Server 11 (x86" 64) VERSION = 11PATCHLEVEL = 3
Second, check whether MySQL has been installed
Kingtry:~ # rpm-qa | grep-I mysqllibmysqlclient_r15-5.0.96-0.6.1libqt4-sql-mysql-4.6.3-5.25.4MySQL-client-community-5.1.73-1.sles11MySQL-server-community-5.1.73-1.sles11
Note that the output MySQL-*, indicates that it has been installed. The beginning of lib can be ignored.
Enter the following command to delete:
Kingtry:~ # rpm-e MySQL-client-community-5.1.73-1.sles11kingtryMySQL-client-community-5.1.73 ~ # rpm-e MySQL-server-community-5.1.73-1.sles11
III. Software preparation
MySQL-server-5.5.60-1.sles11.x86_64.rpmMySQL-client-5.5.60-1.sles11.x86_64.rpm
IV. Installation process
Kingtry:~ # rpm-ivh MySQL-server-5.5.60-1.sles11.x86_64.rpm MySQL-client-5.5.60-1.sles11.x86_64.rpm warning: MySQL-server-5.5.60-1.sles11.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 5072e1f5 setting. # [100%] 1:MySQL-client # [50%] 2:MySQL-server # # # # warning: user mysql does not exist-using rootwarning: group mysql does not exist-using rootinsserv: Service network is missed in the runlevels 4 to use service mysqlmysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off180620 17:57:38 [Note ] Ignoring-- secure-file-priv value as server is running with-- bootstrap.180620 17:57:38 [Note] / usr/sbin/mysqld (mysqld 5.5.60) starting as process 3576... 180620 17:57:39 [Note] Ignoring-- secure-file-priv value as server is running with-- bootstrap.180620 17:57:39 [Note] / usr/sbin/mysqld (mysqld 5.5.60) starting as process 3583... PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER! To do so Start the server, then issue the following commands:/usr/bin/mysqladmin-u root password' new-password'/usr/bin/mysqladmin-u root-h kingtry password' new-password'Alternatively you can run:/usr/bin/mysql_secure_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly recommended for production servers.See the manual for more instructions.Please report any problems at http://bugs.mysql.com/
5. Installation completed
Simple installation process, only need the above command, the current version of the root password is empty, you can use the mysql command to connect and log in directly.
Note: the mysql service does not start automatically after default installation
6. Migration database directory configured after installation
Rpm installs data files to the / var/lib/mysql directory by default, and usually needs to be migrated to another directory, such as / data directory.
Kingtry:~ # mkdir / datakingtry:~ # mv / var/lib/mysql / data
It is important to note that prior to this, mysql-related configurations were always configured with default values. If all mysql options are defaulted, the service will start normally even without the file my.cnf.
However, we changed the path of the data file, which is specified in my.cnf.
1. Copy the my.cnf template file
There are multiple template files in the / usr/share/mysql directory. Copy any one of them.
Kingtry:~ # cp / usr/share/mysql/my-medium.cnf / etc/my.cnf
Modify relevant parameters, mainly socket and datadir, as follows:
# Example MySQL config file for medium systems.## This is for a system with little memory (32m-64m) where MySQL plays# an important part, or systems up to 128m where MySQL is used together with# other programs (such as a web server) # # MySQL programs look for option files in a set of# locations which depend on the deployment platform.# You can copy this option file to one of those# locations. For information about these locations, see:# http://dev.mysql.com/doc/mysql/en/option-files.html## In this file, you can use all long options that a program supports.# If you want to know which options a program supports Run the program# with the "- help" option.# The following options will be passed to all MySQL clients [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/mysqlsocket = / data/mysql/mysql.sockcharacter-set-server=utf8pid-file=/data/mysql/mysql.piduser = Mysql lower_case_table_names=1max_connections=1000#bind-address = 127.0.0.1#skip-name-resolveskip-external-lockingkey_buffer_size = 16Mmax_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 uselessages # # 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-defaults to 1 if master-host is Not set# but will not function as a master if omittedserver-id = 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-and different from the master) # defaults to 2 if master-host is set# but will not function as a slave if omitted#server-id = 2percent # 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/mysql#innodb_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 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 = 50slow_query_log = 1long_query_time = 10log-queries-not-using-indexeslog-error=/data/mysql/mysql.errexpire-logs-days = 10 [mysqldump] quickmax_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 = 20Msort_buffer_size = 20Mread_buffer = 2Mwrite_buffer = 2m [mysqlhotcopy] interactive-timeout
7. Start the mysql service
Kingtry:~ # service mysql start doneStarting MySQL. Donekingtry:~ #
Check to see if the MySQL service has been started:
Kingtry:~ # netstat-nat | grep 3306
VIII. Root password modification after installation
The root password is empty by default, which certainly won't work in a production environment. There are two ways to change the root password, either of which is fine:
1. Command method (Note: the password is changed for the first time, but the password is empty before modification)
Kingtry:~ # mysqladmin-u root password 'root123'
Note that if the root password is no longer empty after performing the above steps, if you want to change the root password again, the above command will not work. You need to use the following command:
Kingtry:~ # mysqladmin-u root-p password 'root1234' Enter password:
This is the current password that you enter interactively. The password parameter is followed by the password you want to change.
2. Modify the database table data mode
Log in to the mysql CVM first
Mysql > use mysqlmysql > update user set password=password ('root123') where user='root';mysql > commit
The firewall allows port 3306.
Kingtry:~ # vi / etc/sysconfig/SuSEfirewall2
Add 3306 ports to FW_SERVICES_EXT_TCP. If there are other ports, spaces are separated, such as:
FW_SERVICES_EXT_TCP= "21 22 3306"
Restart the firewall:
# rcSuSEfirewall2 restart
10. Set up remote access
Log in to mysql CVM first, and authorized root users can log in remotely.
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 >
Note: it is best for a production environment to allow root remote access only on machines with a specific IP.
For the above about how to use the rpm installation package to install MySQL5.5.60 under SuSE11, do you think it is very helpful? If you need to know more, please continue to follow our industry information. I'm sure you'll like it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.