开发目的:在国产银河麒麟系统中搭建TiDB数据库运行环境。
开发工具:银河麒麟系统V10SP1+TiDB+MySql数据库8.0。
具体步骤:
1、在VmWare虚拟机中安装好国产银河麒麟V10Sp1操作系统。
2、打开终端命令,安装TiDB相关软件:
检测更新:sudo apt update
安装curl工具包:sudo apt-get install curl
执行安装命令:curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
刷新当前用户配置:source /home/userlpe/.bashrc
执行命令:tiup playground

浏览器打开http://127.0.0.1:2379/dashboard 访问 TiDB Dashboard 页面,默认用户名为 root,密码为空

浏览器打开http://127.0.0.1:3000 访问 TiDB 的 Grafana 界面,默认用户名和密码都为 admin。

3、 安装MySql数据库相关软件:
安装net-tools工具包:sudo apt-get install net-tools
安装rpm工具包:sudo apt-get install rpm
安装alien工具包:sudo apt-get install alien
下载mysql数据库对应安装包,下载地址:https://downloads.mysql.com/archives/community/。
选择下载 Red Hat Enterprise Linux 8 / Oracle Linux 8 (x86, 64-bit), RPM Bundle安装包
解压下载的安装文件:tar xvf mysql-8.3.0-1.el8.x86_64.rpm-bundle.tar
将mysql安装包对应的rpm转换成deb格式
 sudo alien -d mysql-community-common-8.3.0-1.el8.x86_64.rpm
 sudo alien -d mysql-community-client-plugins-8.3.0-1.el8.x86_64.rpm
 sudo alien -d mysql-community-libs-8.3.0-1.el8.x86_64.rpm
 sudo alien -d mysql-community-client-8.3.0-1.el8.x86_64.rpm
 sudo alien -d mysql-community-icu-data-files-8.3.0-1.el8.x86_64.rpm
 sudo alien -d  mysql-community-server-8.3.0-1.el8.x86_64.rpm
 sudo alien -d  mysql-community-devel-8.3.0-1.el8.x86_64.rpm

执行命令安装deb格式文件
 sudo dpkg -i mysql-community-common_8.3.0-2_amd64.deb  
 sudo dpkg -i mysql-community-client-plugins_8.3.0-2_amd64.deb  
 sudo dpkg -i mysql-community-libs_8.3.0-2_amd64.deb   
 sudo dpkg -i mysql-community-client_8.3.0-2_amd64.deb       
 sudo dpkg -i mysql-community-icu-data-files_8.3.0-2_amd64.deb  
 sudo dpkg -i mysql-community-server_8.3.0-2_amd64.deb
 sudo dpkg -i mysql-community-devel_8.3.0-2_amd64.deb   

连接mysql数据库指令
 mysql --comments --host 127.0.0.1 --port 4000 -u root
 测试mysql 数据库操作
 userlpe@userlpe-XQF222:~/下载$ mysql --comments --host 127.0.0.1 --port 4000 -u root
 Welcome to the MySQL monitor.  Commands end with ; or \g.
 Your MySQL connection id is 3642753032
 Server version: 8.0.11-TiDB-v8.0.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 8.0 compatible
Copyright (c) 2000, 2024, 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> show databases;
 +--------------------+
 | Database           |
 +--------------------+
 | INFORMATION_SCHEMA |
 | METRICS_SCHEMA     |
 | PERFORMANCE_SCHEMA |
 | mysql              |
 | sys                |
 | test               |
 +--------------------+
 6 rows in set (0.00 sec)
 更新mysql数据库密码
 mysql> update mysql.user set authentication_string=password('abc123456') where user='root' ;
 Query OK, 1 row affected, 1 warning (0.06 sec)
 Rows matched: 1  Changed: 1  Warnings: 1
更新mysql密码后,登录TiDB管理界面http://127.0.0.1:2379/dashboard/#/cluster_info/instance时候需要重新输入root用户对应的密码,进入管理界面后能看到对应的所有执行的增删改查SQL语句。

至此基本完成国产数据库TiDB的搭建过程。