Whakauruhia me te whirihora i taku MySQL8 ki CentOS7

Tohutoro

Paetukutuku mana Tuhinga Tuhinga

Taapirihia te konae REPO

Whakamahia te vi, to vim ranei hei whakatika i te /etc/yum.repos.d/mysql-community.repo file, kape i nga korero e whai ake nei ki te konae, ka penapena ka puta.

            [mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
        

Mahia te whakauru

            yum -y install mysql-community-server
        

Whakakētia te konae whirihoranga

Whakamahia vi or vim hei whakatika /etc/my.cnf. Ka rite ki te MySQL8 kua whakataurite ki te waahanga o mua, ko te tikanga tukatuka taunoa o te takiuru, te tauākī korero SQL me te kore e roroa o te roa o te mara i whakarereke, no reira mena me pupuri taatau i mua, mahia te whirihoranga e whai ake nei. Mena kaore koe e hiahia kia hototahi ki te hotaka tawhito, ka taea e koe te wareware. I roto i te whirihoranga kua whakarerekehia o te tauira e whai ake nei, ko nga mea tuatahi e toru mo te hototahi me nga tikanga whakamahi o te waahanga tawhito, a ko te mea whakamutunga hei whakarereke i te raarangi rokiroki taunoa o te papaarangi.

            default_authentication_plugin=mysql_native_password
validate_password.policy=LOW
sql_mode=NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
datadir=/mysqldata
        

Tīmata ratonga

            systemctl enable mysqld
systemctl start mysqld
        

Tikina te kupuhipa hononga taunoa

Ko te kupuhipa takiuru o te pakiaka taketake o MySQL8 kei te rongoa ki te konae rākau, a me tirohia e tatou mai i te konae rakau

            grep "password" /var/log/mysqld.log
        

Ratonga Manatoko

I tenei wa kua oti ta maatau whakauru me te whirihoranga, ka whakamahia te raina whakahau ki te hono atu ki te ratonga MySQL, ana ka hanga he papaarangi me tetahi kaute.

            mysql -uroot -p