Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql 5.7rpm from download to installation

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Miscellaneous knowledge points:

Synchronization time:

Yum-y install ntp

Whereis ntp

Ntpdate time.nist.gov synchronizes the time command, and then adds a scheduled task. Nist (national institut of standard technology)

Crontab-e

* / 10 * ntpdate time.nist.gov

Mysql 5.7installation: environment: virtualbox virtual machine on mac: NAT mode. OS:centos6.7 .

Wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.19-1.el6.x86_64.rpm-bundle.tar

Tar-xf mysql-5.7.19-1.el6.x86_64.rpm-bundle.tar

You need to uninstall the existing mysql:rpm-e-nodeps mysql first. Rpm

Install in the following order because of the dependencies between them

Common-- > libs-- > clients-- > server

$rpm-ivh mysql-community-common-5.7.19-1.el6.x86_64.rpm $rpm-ivh mysql-community-libs-5.7.19-1.el6.x86_64.rpm $rpm-ivh mysql-community-clients-5.7.19-1.el6.x86_64.rpm $rpm-ivh mysql-community-server-5.7.19-1.el6.x86_64.rpm

If this error occurs: (this error I did not encounter when installing)

Error: Failed dependencies:\ libnuma.so.1 () (64bit) is needed by mysql-community-server-5.7.19-1.el6.x86_64\ libnuma.so.1 (libnuma_1.1) (64bit) is needed by mysql-community-server-5.7.19-1.el6.x86_64\ libnuma.so.1 (libnuma_1.2) (64bit) is needed by mysql-community-server-5.7.19-1.el6.x86_64

Solution:

Yum install-y numactl

After the installation is complete:

Want to know where the installation is:

Whereis mysqld

Which mysqld

Initialize mysqld:

1. Setenforce 0 closes SELINUX, otherwise an error will be reported.

2. / usr/sbin/mysqld-user=mysql-datadir=/usr/local/src/mysql5.7/

Start mysqld:

Service mysqld start

Ps-ef | grep mysql

Log in to mysqld with the mysql client:

Mysql-u root-p this root has nothing to do with the root of the linux system, and is a root user of mysqld.

If an error is reported: mysql.sock cannot be found, vim / etc/my.cnf is required

Add:

[mysql]

Socket=/usr/local/src/mysql5.7/mysql.sock

Restart the mysqld service.

Note: enter the password: version 5.7 will be placed in the mysql log file during initialization and 5.6 in the ~. / mysql_secret file. After finding the password in log, paste it.

After logging in, you will be prompted that your password has expired or that you must change your password.

Modify password rules:

SHOW VARIABLES LIKE 'validate_password%'

Set global validate_password_policy=0

Set the rules to 0, and the lowest password rule also requires 4 digits.

Set the password:

Set password = password ('123456')

View the engines supported by mysql:

Show engines

View the table creation process:

Show create table table name

Modify the engine of the table:

ALTER TABLE engine table name ENGINE = INNODB

All right, let's create a library and table to play with:

Build a database: create database myuser

Enter the library: use myuser

Table creation: create table nason (id int (100,100) not null,password varchar (255mm) not null,sex int (2), age int (10), phone int (11), email varchar (100), role int (10)) ENGINE=InnoDB DEFAULT CHARSET=utf8

Mysql, using the tab completion feature, only needs to modify the my.cnf configuration file.

[mysql] # no-auto-rehashauto-rehash # add auto-rehash

You are welcome to correct, supplement and make common progress.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report