首页 > 数据库 >离线安装mysql

离线安装mysql

时间:2023-12-28 22:01:02浏览次数:42  
标签:8.0 slave root 31 离线 mysql Oracle 安装

[root@slave ~]# ls
anaconda-ks.cfg  mysql-8.0.31-linux-glibc2.12-x86_64.tar.xz
[root@slave ~]# tar -xf mysql-8.0.31-linux-glibc2.12-x86_64.tar.xz
[root@slave ~]# ls
anaconda-ks.cfg  mysql-8.0.31-linux-glibc2.12-x86_64  mysql-8.0.31-linux-glibc2.12-x86_64.tar.xz
[root@slave ~]# mv mysql-8.0.31-linux-glibc2.12-x86_64 /usr/local/mysql
[root@slave ~]# groupadd mysql
[root@slave ~]# useradd -g mysql mysql
[root@slave ~]# chown -R mysql:mysql /usr/local/mysql/
[root@slave ~]# cd /usr/local/mysql/bin/
[root@slave bin]# ./mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --initialize --lower-case-table-names=1
[root@slave bin]# cat > /etc/my.cnf<
[mysqld] 
basedir=/usr/local/mysql/ 
datadir=/usr/local/mysql/data/ 
socket=/tmp/mysql.sock 
character-set-server=UTF8MB4 
lower_case_table_names  = 1 
bind-address=0.0.0.0 sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION EOF
[root@slave bin]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql 
[root@slave bin]# service mysql start
[root@slave bin]# source /etc/profile
[root@slave bin]# mysql -u root -p
[root@slave bin]# cd
[root@slave ~]# mysql -u root -p

Enter password:

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

Your MySQL connection id is 10

Server version: 8.0.31 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> exit

Bye

[root@slave ~]# init 0

oot@slave bin]# mysql -u root -p

-bash: mysql: 未找到命令

[root@slave bin]# cd

[root@slave ~]# mysql

[root@slave ~]# mysql -u root -p

Enter password:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

[root@slave ~]# mysql -u root -p

Enter password:

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

Your MySQL connection id is 9

Server version: 8.0.31

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> alter USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mysql';

Query OK, 0 rows affected (0.02 sec)

mysql> \q

Bye

[root@slave ~]# mysql -u root -p

Enter password:

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

Your MySQL connection id is 10

Server version: 8.0.31 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> exit

Bye

[root@slave ~]# init 0

标签:8.0,slave,root,31,离线,mysql,Oracle,安装
From: https://blog.51cto.com/u_14871454/9018769

相关文章

  • 【靶场部署】kali系统安装
    一,简介kali是一个基于Linuxkernel的操作系统,用于渗透测试及黑客攻防的专用平台,其主要功能有三个:数字取证、安全审计、渗透测试。二,下载与安装2.1下载链接:https://www.kali.org/2.2新建VM虚拟机 如果下载的压缩包,里面直接包含有虚拟机全部内容,直接解压到合适位置即可。......
  • elasticsearch安装部署(单机和集群)
    一、单机模式1、单机模式,下载对应es包,此次使用版本为7.8.0版本并解压-rw-r--r--.1rootroot31911256112月2815:39elasticsearch-7.8.0-linux-x86_64.tar.gzmkdires_standalonemvelasticsearch-7.8.0-linux-x86_64.tar.gzes_standalone2、因安全限制,linux中不允......
  • Ubuntu23.04下anaconda3的安装、配置
    一.安装anaconda3前往清华园镜像下载anaconda3的安装包https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=D选择最新镜像Anaconda3-2023.09-0-Linux-x86_64.sh 安装1bashAnaconda3[version].shversion是下载的包的版本,如:bash Anaconda3-2023.09-0-L......
  • 在Windows环境下安装xmind
    在Windows环境下安装xmindxmind是什么xmind是一款思维导图软件,应用EclipseRCP软件架构,打造易用、高效的可视化思维软件,强调软件的可扩展、跨平台、性能,致力于帮助用户提高生产力。xmind采用Java语言开发,具备跨平台运行的性质、且基于EclipseRCP体系架构,可支持插件,插件通过编......
  • JAVA基础+安装
    Java特性高效可跨平台不占内存不需要指针Java三大版本Writeonce,runanywhere.JavaSE:标准版(桌面程序,控制台开发……)JavaME:嵌入式开发(手机,小家电……)JavaEE:E企业级开发(web端,服务器开发)JDK、JRE、JVMJDK:JavaDevelopmentKitJava开发者工具JRE:JavaRuntimeEnvi......
  • 安路TD5.6.1安装步骤【附安装包】
    1.双击安装包TD_rel220906_r5.6.1_59063_64bit.msi2.直接下一步3.选择安装位置,进行安装4.安装完成后找到安装路径license下5.这样就可以正常使用软件了软件安装下载链接:链接:https://pan.baidu.com/s/1c4CO0yycTdCg0bVFQuyLbg提取码:1114......
  • kafka下载、安装与部署
    1.kafka简介kafka官网地址:https://kafka.apache.org/kafka的本质是一个数据存储平台,流平台,只是他在做消息发布,消息消费的时候我们可以把他当做消息中间件来用。Kafka提供了一个KafkaBroker、一个KafkaProducer和一个KafkaConsumer。以下介绍源自:文心一言。KafkaBro......
  • Steam自建服务器教程之SteamCMD的下载和安装
     一、SteamCMD是干嘛的?SteamCMD 是 Steam 客户端的命令行版本。方便开发者管理Steam游戏服务器和下载游戏文件、更新游戏内容等。如果是你想要在Steam自建服务器,进行二次开发,SteamCMD是必需工具。今天飞飞将和你分享不同系统下载和安装SteamCMD的方法,希望可以帮助到你~ ......
  • 全志R128 DSP开发工具安装教程
    资料准备要编译和仿真DSP,需要以下资料:DSP核SDK,SDK需要包含DSP编译源码。CadenceXtensa的WindowsIDE工具(Xplorer‑8.0.13版本),Windows版本DSP的package包。CadenceXtensa的License,用于服务器代码编译和Xplorer仿真使用。其中Allwinner提供DSP核SDK源码......
  • C++ Qt开发:Qt的安装与配置
    Qt是一种C++编程框架,用于构建图形用户界面(GUI)应用程序和嵌入式系统。Qt由Qt公司(前身为Nokia)开发,提供了一套跨平台的工具和类库,使开发者能够轻松地创建高效、美观、可扩展的应用程序。其被广泛用于开发桌面应用程序、嵌入式系统、移动应用程序等。无论是初学者还是经验丰富的开发者,Q......