首页 > 编程知识 正文

服务器新装mysql,服务器新装网卡识别不了

时间:2023-12-28 11:57:04 阅读:328250 作者:WXIN

本文目录一览:

阿里云服务器如何安装MySQL数据库

1.查看mysql编辑情况rpm -qa|grep mysql

2.卸载原有的mysql rpm -e --nodeps mysql 

 //

强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除

3.通过命令查看yum上面提供的可下载版本  yum list | grep mysql

4.安装mysql客户端和服务端 yum install -y mysql-server mysql mysql-deve

5.查看mysql启动状态 mysql service status

6.登录mysql提示

7.修改mysql的root密码

service mysqld stop

无密码登录mysql:mysqld_safe --skip-grant-tables

输入mysql -uroot -p 直接回车进入mysql客户端页面

use mysql;

update user set password=PASSWORD("root")where user="root";修改密码

flush privileges; 更新权限

service mysqld restart

 最后直接登录 mysql -u root -p回车输入密码

linux服务器上怎么安装mysql

安装包:mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz

使用xshell连接linux服务器,使用root用户名登录,依次执行以下命令:

======================================================

/usr/sbin/groupadd mysql 【添加mysql组】

/usr/sbin/useradd -d /var/lib/mysql -s /sbin/nologin -g mysql mysql

mkdir -p /usr/local/src/mysql 【新建mysql文件夹】

cd / 【打开上传安装包的目录】

mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz 【上传安装包到服务器的根目录下】

mv mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz /usr/local/src/mysql【根目录的安装包移动到文件夹下】

cd /usr/local/src/mysql【打开目录】

tar -zxvf mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz【解压安装包】

cp mysql-5.6.30-linux-glibc2.5-x86_64 /usr/local/mysql -r【复制文件】

cd /usr/local【打开目录】

chown -R mysql:mysql mysql/

cd /usr/local/mysql/scripts/【打开目录】

./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data【执行脚本】

cd /usr/local/mysql/support-files【打开目录】

cp my-default.cnf /etc/my.cnf【复制文件到新的路径下及文件名】

cp: overwrite `/etc/my.cnf'?Y【Y】

cp mysql.server /etc/init.d/mysql【复制文件到新的路径下】

vim /etc/profile【编辑软件运行环境】

vim i(编辑一些内容) esc(进入normal) w(保存文件) q(不保存退出文件)

###############################################################

export MYSQL_HOME=/usr/local/mysql

export PATH=$MYSQL_HOME/bin:$PATH

###############################################################

source /etc/profile

chkconfig --add mysql

chkconfig mysql on

service mysql start

/usr/local/mysql/bin/mysqladmin -u root password 'rootroot'【修改数据库root的密码】

grant all privileges on tdcdb.* to 'root'@'%' identified by 'rootroot' 【给mysql用户分配权限】

flush privileges;

vim /etc/sysconfig/iptables【编辑访问端口号】

###############################################################

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT(添加3306的端口号)

###############################################################

service iptables restart

netstat -ntlp

mysql -u root -p (命令未找到使用: ln -s /usr/local/mysql/bin/mysql /usr/bin)

create user 'tdc'@'%' identified by 'P@ssw0rd';【创建数据库访问用户】

create database if not exists `tdcdb`;【创建数据库】

grant all privileges on tdcdb.* to 'tdc'@'%' identified by 'P@ssw0rd';【给tdc用户分配访问密码】

flush privileges;

vi /etc/my.cnf【编辑配置文件,支持语言设置】

###############################

[client]

default-character-set=utf8

[mysqld]

character-set-server=utf8

[mysql]

default-character-set=utf8

###############################

service mysql stop【重新启动mysql服务】

service mysql start

======================================================

linux 常用命令:

pwd:查看当前路径

ll:2个小写的L,查看当前目录下的所有文件

cd:打开目录,包括路径地址及文件夹

vi 文件名:编辑linux下的文件,使用大写的【I】命令来进行编辑,编辑完成后点击【ESC】按钮跳出编辑,输入【:wq!】命令来退出保存;

注意:linux的文件不能打开直接修改,只能通过vi命令进行修改

======================================================

卸载程序的方式:

ps -ef | grep mysql

/etc/init.d/mysql status

whereis mysql

find / -name mysql【找到所有文件名为mysql的文件列表】

rm -rf /usr/local/mysql/【使用rm命令来移除列表中的文件】

rm -rf /etc/my.cnf【使用rm命令来移除列表中的文件】

如何在一台服务器上安装两个mysql或者更多

这种架构一般用在以下三类场景

1. 备份多台 Server 的数据到一台如果按照数据切分方向来讲,那就是垂直切分。比如图 2,业务 A、B、C、D 是之前拆分好的业务,现在需要把这些拆分好的业务汇总起来备份,那这种需求也很适用于多源复制架构。实现方法我大概描述下:业务 A、B、C、D 分别位于 4 台 Server,每台 Server 分别有一个数据库来隔离前端的业务数据,那这样,在从库就能把四台业务的数据全部汇总起来,而不需要做额外的操作。那没有多源复制之前,要实现这类需求,只能在汇总机器上搭建多个 MySQL 实例,那这样势必会涉及到跨库关联的问题,不但性能急剧下降,管理多个实例也没有单台来的容易。

2. 用来聚合前端多个 Server 的分片数据。

同样,按照数据切分方向来讲,属于水平切分。比如图 3,按照年份拆分好的数据,要做一个汇总数据展现,那这种架构也非常合适。实现方法稍微复杂些:比如所有 Server 共享同一数据库和表,一般为了开发极端透明,前端配置有分库分表的中间件,比如爱可生的 DBLE。

3. 汇总并合并多个 Server 的数据

第三类和第一种场景类似。不一样的是不仅仅是数据需要汇总到目标端,还得合并这些数据,这就比第一种来的相对复杂些。比如图 4,那这样的需求,是不是也适合多源复制呢?答案是 YES。那具体怎么做呢?

怎么安装mysql服务端

1、首先,解压下载的MySql安装包。

2、双击打开解压后的包,点击如图程序。

3、勾选协议,点击next。

4、选择安装类型,点击下一步。

5、设置安装路径。

6、点击install。

7、点击finsh。

8、点击下一步。

9、选择配置类型。

10、根据自己的需求选择配置。

11、勾选第一个,点击next。

12、设置并发量。

13、设置端口。

14、设置字符编码。

15、设置服务器配置。

16、设置账户和密码。

17、点击excute。

18、点击finsh,安装完毕。

如何安装MYSQL

使用yum安装mysql数据库的软件包 [root@xuegod63 ~]# yum -y install mariadb-server mariadb 。

注:  mariadb-server   #MariaDB数据库 mariadb      # MariaDB服务器Linux下客户端 。

注:从centos7系统开始,系统中自带的mysql数据库变成了mariadb-server,mariadb-server和mysql操作上一样。mariadb-server是mysql的一个分支。

启动数据库服务[root@xuegod63 ~]# systemctl start  mariadb  #启动MariaDB服务。[root@xuegod63 ~]# systemctl enable  mariadb  #设置开启自动启动MariaDB服务。

安装完mariadb-server后,运行mysql_secure_installation去除安全隐患,[root@xuegod63 ~]# mysql_secure_installation #进入安全配置导向。

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQLSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current,password for the root user. If you've just installed MySQL, and,you haven't set the root password yet, the password will be blank,,so you should just press enter here.Enter current password for root (enter for none):   #初次运行直接回车,因为root用户没有密码。

OK, successfully used password, moving on,Setting the root password ensures that nobody can log into the MySQL,root user without the proper authorisation.,Set root password? [Y/n] Y #是否设置root用户密码,输入Y。

New password: 123456   #新密码123456,Re-enter new password: 123456,Password updated successfully!Remove anonymous users? [Y/n] Y   #是否删除匿名用户,生产环境建议删除,所以直接回车或Y。

Success!Normally, root should only be allowed to connect from 'localhost'.  Thisensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] Y  #是否禁止root远程登录,根据自己的需求选择Y/n并回车建议禁止。

Success!By default, MariaDB comes with a database named 'test' that anyone canaccess.  This is also intended only for testing, and should be removedbefore moving into a production environment.Remove test database and access to it? [Y/n] Y   #是否删除test数据库,直接回车或Y。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。