-
现在网上很多关于MySQL数据库安装教程新旧不一,并且由于centos系统版本不同,所用镜像源不同,很多解决方法已经不适用。这篇文章主要用于组内项目服务器开发过程展示总结,内容均为原创,转载请注明来源,文章中有纰漏之处还望斧正。当然如果能够帮助大家解决一些服务器搭建问题那就再好不过。1. MySQL安装过程中的常见问题MySQL依赖问题默认的rmp源不稳定下面我先给出MySQL安装的步骤及命令行代码,在遇到以上问题的时候我会给出解决方案。2. MySQL安装步骤依次执行下面三行代码:wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm yum -y install mysql57-community-release-el7-10.noarch.rpm yum -y install mysql-community-server --nogpgcheck centos7中默认安装有MariaDB,这个是MySQL的分支,但在安装完MySQL之后可以直接覆盖掉MariaDB。下面进行mysql的配置,执行以下命令,启动MySQL服务:systemctl start mysqld systemctl enable mysqld查看MySQL运行状态:systemctl status mysqld.service● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2022-05-17 17:19:25 CST; 1min 1s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 656 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS) Process: 589 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 837 (mysqld) CGroup: /system.slice/mysqld.service └─837 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid May 17 17:19:22 hecs-340553 systemd[1]: Starting MySQL Server... May 17 17:19:25 hecs-340553 systemd[1]: Started MySQL Server.执行以下命令,获取安装MySQL时自动设置的root用户密码:grep 'temporary password' /var/log/mysqld.log如果回显信息中密码为空,则说明没有自动设置密码,如果有自动设置密码,需要复制在下一步中使用。执行以下命令,并按照回显提示信息进行操作,加固MySQL:mysql_secure_installationSecuring the MySQL server deployment. Enter password for user root: #输入上一步骤中获取的安装MySQL时自动设置的root用户密码 The existing password for the user account root has expired. Please set a new password. New password: #设置新的root用户密码 Re-enter new password: #再次输入密码 The 'validate_password' plugin is installed on the server. The subsequent steps will run with the existing configuration of the plugin. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : N #是否更改root用户密码,输入N ... skipping. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y #是否删除匿名用户,输入Y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y #禁止root远程登录,输入Y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y #是否删除test库和对它的访问权限,输入Y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y #是否重新加载授权表,输入Y Success. All done!执行以下命令,再根据提示输入数据库管理员root账号的密码进入数据库:mysql -u root -p执行以下命令,使用MySQL数据库:use mysql;执行以下命令,查看用户列表:select host,user from user;执行以下命令,mysql默认不允许远程主机,%表示允许所有主机连接。刷新用户列表并允许所有IP对数据库进行访问,方面后续使用数据库软件进行管理:update user set host='%' where user='root' LIMIT 1;执行以下命令,强制刷新权限。允许同一子网中设置为允许访问的云服务器通过私有IP对MySQL数据库进行访问:flush privileges;执行以下命令,退出数据库:quit执行以下命令,重启MySQL服务systemctl start mysqld执行以下命令,设置开机自动启动MySQL服务:systemctl enable mysqld执行以下命令,关闭防火墙:systemctl stop firewalld.service重新查看防火墙状态是否为关闭:systemctl status firewalld● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1)3.MySQL依赖问题出现依赖问题或版本冲突建议先将mysql相关文件全部删除,再重新进行mysql安装。yum remove mysql mysql-server mysql-libs mysql-server查找残留文件:rpm -qa | grep -i mysql将查询出来的文件逐个删除,这里需要用到删除命令,比如:yum remove mysql-community-common-5.7.29-1.el6.x86_64查找残留目录,如果有残留文件,再逐一删除(这样能将mysql文件删除干净,方面重新安装):whereis mysql rm –rf /usr/lib64/mysql 检测系统是否存在mysql:yum list installed|grep mysql删除完毕后重新按照以上流程按照即可。4. 默认的rmp源不稳定,如何进行rmp源更新给CentOS添加rpm源,并且选择较新的源:wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm --no-check-certificate yum localinstall mysql-community-release-el6-5.noarch.rpm yum repolist all | grep mysql yum repolist enabled | grep mysql查看可获得的mysql版本,进行下载:yum list | grep mysql yum -y install mysql-community-server然后在根据流程进一步操作即可。
-
本地四张地图都能够正常运行,但是到了服务器上有一张地图没有得分。除此之外,服务器的运行分数普遍比本地要低一些,这是为什么呀
-
1.官网下载驱动源码包地址:cid:link_0环境 openeuler22.03-LTS x86 aarch642.tar -xvf ixgbe-5.16.5.tar.gz3.把附件中的文件替换解压出来的文件文件 ixgbe_ethtool.c 路径 ixgbe-5.16.5/src/4.cd ixgbe-5.16.5/src/5.make install
-
请问使用atc进行模型编译时,output_shape的三个选项UINT8和FP16,FP32。其中的UINT8是代表模型量化吗?这三者的推理速度谁应该更快呢?
-
HCIP-Kunpeng Application Developer考证体验——Go应用迁移第一步购买服务器本次实验需要在两个不同的平台运行GO应用程序,需要两个不同的服务器首先先看看两个服务器的基础配置x86服务器:1、x86计算2、通用计算增强型3、c6.latge.2 2vCPUs | 4GB,openEuler 20.03 64bit鲲鹏服务器:1、鲲鹏计算2、鲲鹏通用计算增强型3、kc1.2xlarge.2 8vCPUs | 16GB,Ubuntu 18.04 server 64bit with ARM尝试在x86服务器上运行GO Wed服务器首先安装GO可能有些人会将两台服务器弄混,使用以下命令可以查看系统信息uname -a1、下载GO软件包,命令行输入以下命令https://kunpeng-ip.obs.cn-north-4.myhuaweicloud.com/å®éªèµæº/3.2%20Goè¯è¨ä»£ç ç§»æ¤/go1.15.3.linux-amd64.tar.gz2、将下载好的软件包解压到指定的目录,输入如下命令,这里解压到/usr/local目录下tar -C /usr/local -xzvf go1.15.3.linux-amd64.tar.gz3、为GO添加环境变量,编辑文档/etc/profilevim /etc/profile在文件的最后添加上如下的代码(根据自己解压位置编写)export GOPATH=/usr/local/goexport PATH=$PATH:/usr/local/go/bin然后返回到根目录使配置生效:source /etc/profile4、使用命令验证go 安装成功go version可以返回以下版本信息表明安装成功go version go1.15.3 linux/amd64在Web服务上运行go应用1、在根目录下创建go文件,命名为hello-world.go,开始编写go程序vim hello-world.go2、输入以下简单代码作为第一个简单运用package mainimport ("fmt""net/http")func main() {http.HandleFunc("/", HelloServer)http.ListenAndServe(":8080", nil)}func HelloServer(w http.ResponseWriter, r *http.Request) {fmt.Fprintf(w, "Hello, %s!", r.URL.Path[1:])}3、运行go文件,注意不要停止运行go run hello-world.go4、使用本地浏览器访问x86 ECS的EIP:8080/{string},如http://EIP:8080/x86。其中{string}可以替换为任意字符串,EIP代表ecs的公网地址Build Web服务器1、使用CTRL+c停止web服务器2、查看编译过程go build -x hello-world.go主要的编译过程如下WORK=/tmp/go-build389519517mkdir -p $WORK/b001/cat >$WORK/b001/importcfg.link << 'EOF' # internalpackagefile command-line-arguments=/root/.cache/go-build/b6/b6b1dd0c1f72d9a5d4fee29a84b4b03b5e11311a7bf56f9a3c8763fefbf0207c-dpackagefile fmt=/usr/local/go/pkg/linux_amd64/fmt.apackagefile net/http=/usr/local/go/pkg/linux_amd64/net/http.a…packagefile unicode/utf16=/usr/local/go/pkg/linux_amd64/unicode/utf16.aEOFmkdir -p $WORK/b001/exe/cd ./usr/local/go/pkg/tool/linux_amd64/link -o $WORK/b001/exe/a.out -importcfg $WORK/b001/importcfg.link -buildmode=exe -buildid=SorAHn0T2Skvlp1JWBKs/R3Uv0wV9aW3nbbiABvZ5/Ls8w5Ac4hNlunE_gSND6/SorAHn0T2Skvlp1JWBKs -extld=gcc /root/.cache/go-build/b6/b6b1dd0c1f72d9a5d4fee29a84b4b03b5e11311a7bf56f9a3c8763fefbf0207c-d/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b001/exe/a.out # internalcp $WORK/b001/exe/a.out hello-worldrm -r $WORK/b001/3、查看文件,生产了hello-world4、运行可执行文件./hello-world5、使用本地浏览器访问x86 ECS的EIP:8080/{string},EIP代表x86服务器的私网ip使用ctrl+c停止web服务器在鲲鹏云服务器运行Go Web服务器安装GO1、下载GO安装包wget https://kunpeng-ip.obs.cn-north-4.myhuaweicloud.com/å®éªèµæº/3.2%20Goè¯è¨ä»£ç ç§»æ¤/go1.15.3.linux-amd64.tar.gz2、解压到指定的目录下tar -C /usr/local -xzvf go1.15.3.linux-arm64.tar.gz3、安装上一个服务器的配置添加环境变量vim /etc/profile在文件最后添加如下配置export PATH=$PATH:/usr/local/go/binexport GOROOT=/usr/local/goexport GOPATH=$HOME/goexport PATH=$PATH:$GOPATH/bin返回根目录,使用如下命名使配置生效:source /etc/profile4、验证GO是否安装成功go version如果返回版本信息代表安装成功go version go1.15.3 linux/arm64运行Web服务器1、从x86服务器拷贝可执行文件到鲲鹏ecsscp root@EIP:/root/hello-world /root/ (EIP代表x86服务器的私网ip)这里直接拷贝到了根目录下第一个红框位置,输入YES后按回车;第二个红框位置,输入x86的root密码后按回车。使用命令查看文件已经拷贝到鲲鹏服务器ll2、运行可执行文件./hello-world会发现在这里会报错,这是因为x86和鲲鹏平台差异导致执行格式错误,无法执行x86的二进制文件,需要在鲲鹏平台重新编译源码。Build web服务器1、从x86拷贝源码文件,同样拷贝到根目录下scp root@EIP:/root/hello-world.go /root/2、重新编译源码,这里注意这次编译将编译后的文件命名为hello-world-kpgo build -x -o hello-world-kp hello-world.go主要的编译过程WORK=/tmp/go-build858683415mkdir -p $WORK/b001/cat >$WORK/b001/importcfg.link << 'EOF' # internalpackagefile command-line-arguments=/root/.cache/go-build/a8/a813454c9a5fa88725dce14a80aa5dcf0e8a86c23b87c8085aec03a3173c4495-dpackagefile fmt=/usr/lib/golang/pkg/linux_arm64/fmt.apackagefile net/http=/usr/lib/golang/pkg/linux_arm64/net/http.a…packagefile vendor/golang.org/x/text/transform=/usr/lib/golang/pkg/linux_arm64/vendor/golang.org/x/text/transform.aEOFmkdir -p $WORK/b001/exe/cd ./usr/lib/golang/pkg/tool/linux_arm64/link -o $WORK/b001/exe/a.out -importcfg $WORK/b001/importcfg.link -buildmode=exe -buildid=XFj__tL-9CaZ6vOMXHrY/qWDDtRnClpz5sw1UnAQT/qu7Q7CWlnhkC24dw2YLs/XFj__tL-9CaZ6vOMXHrY -extld=gcc /root/.cache/go-build/a8/a813454c9a5fa88725dce14a80aa5dcf0e8a86c23b87c8085aec03a3173c4495-d/usr/lib/golang/pkg/tool/linux_arm64/buildid -w $WORK/b001/exe/a.out # internalcp $WORK/b001/exe/a.out hello-world-kprm -r $WORK/b001/3、查看文件ll4、这里试着运行新编译的hello-world-kp文件 ./hello-world-kp5、浏览器访问鲲鹏ecs的EIP:8080/{string}
推荐直播
-
HDC深度解读系列 - Serverless与MCP融合创新,构建AI应用全新智能中枢2025/08/20 周三 16:30-18:00
张昆鹏 HCDG北京核心组代表
HDC2025期间,华为云展示了Serverless与MCP融合创新的解决方案,本期访谈直播,由华为云开发者专家(HCDE)兼华为云开发者社区组织HCDG北京核心组代表张鹏先生主持,华为云PaaS服务产品部 Serverless总监Ewen为大家深度解读华为云Serverless与MCP如何融合构建AI应用全新智能中枢
回顾中 -
关于RISC-V生态发展的思考2025/09/02 周二 17:00-18:00
中国科学院计算技术研究所副所长包云岗教授
中科院包云岗老师将在本次直播中,探讨处理器生态的关键要素及其联系,分享过去几年推动RISC-V生态建设实践过程中的经验与教训。
回顾中 -
一键搞定华为云万级资源,3步轻松管理企业成本2025/09/09 周二 15:00-16:00
阿言 华为云交易产品经理
本直播重点介绍如何一键续费万级资源,3步轻松管理成本,帮助提升日常管理效率!
回顾中
热门标签