Get the App
SLTechnology News&Howtos  ›  Database  › 

Getting started with MySQL installation

Shulou Source: shulou.com Published: 2022-05-31 18:22:47 10月30日 Update

This article introduces the relevant knowledge of "getting started with MySQL installation". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Install mysql

1) rpm install mysql5.7

Mysql-community-devel-5.7.12-1.el6.x86_64.rpm

Mysql-community-libs-5.7.12-1.el6.x86_64.rpm

Mysql-community-test-5.7.12-1.el6.x86_64.rpm

Mysql-community-client-5.7.12-1.el6.x86_64.rpm

Mysql-community-common-5.7.12-1.el6.x86_64.rpm

Mysql-community-server-5.7.12-1.el6.x86_64.rpm

If there is a conflicting installation, uninstall it first, such as:

Rpm-e mysql-libs-5.1.66-2.el6_3.x86_64-- nodeps

2) start mysql

Service mysqld start

3) modify the root user password of mysql

If you modify the socket file location at / etc/my.cnf, you should also modify the socket file location of [mysql].

# mysqld_safe-user=mysql-skip-grant-tables-skip-networking &

# mysql-u root mysql

/ / mysql5.6

/ / mysql > UPDATE user SET Password=PASSWORD ('newpassword') where USER='root'

/ / mysql5.7

Mysql > UPDATE user SET authentication_string=PASSWORD ('aaa123') where USER='root'

/ / use desc user to view table field descriptions

Mysql > FLUSH PRIVILEGES

Mysql > quit

Re-execute:

Mysql > SET PASSWORD = PASSWORD ('123456')

Or

Mysql > alter user root@localhost identified by 'aaAA1234

* rpm installation, basedir is / usr

4) root user logs in to mysql

[root@vm1] # mysql-uroot-p

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 5

Server version: 5.7.12 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

Affiliates. Other names may be trademarks of their respective

Owners.

Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.

Mysql >

This is the end of the introduction to "getting started with MySQL installation". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Mode location content files more users knowledge practicality learning and then at the same time dilemmas fields actual passwords situations articles cases tapes websites Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS OPPO Reno Apple Shulou Information MySQL