阿里云服务器启动mysql(阿里云服务器创建数据库)

admin 168 2023-04-15

阿里云服务器优惠多,折扣错,惊喜多,请咨询:www.wqiis.com

本文目录一览:

关于如何连接阿里云服务器上的MySQL数据库的解答

用 SSH客户端登录上以后

首先启动数据库:

[root@iZm5ec880z2rorZ ~]# service mysqld start

可以输入一下加粗命令:

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

Enter password: (输入你运谨碰的数据库密码)

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

Your MySQL connection id is 5

Server version: 5.1.73-log MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

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 use mysql

Database changedmysql GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'ldyu123' WITH GRANT OPTION;

Query OK, 0 rows affected (0.00 sec)

mysql commit;

Query OK, 0 rows affected (0.00 sec)

mysql flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql  exit;

退出后晌悔,输入下边的命令:

[root@iZm5ec880z2rorZ ~]# service mysqld restart

Shutting down MySQL...                                     [  OK  ]

Starting MySQL.          旁谈                                  [  OK  ]

请教阿里云主机的mysql停止和启动的命令是啥linux

阿里云ECS云服务器 --(ubunto)

Bitvise SSH --和阿里云通讯,免费的,从putty主页上下载的

Notepadd++ --免费的文件编辑

方法/步骤

下载免费的Bitvise用来和阿里云通讯。

根据阿里云的ip地址和账户信息设置SSH链接。

点击login,同时打开命令窗口和SFTP窗口(类似ftp那样的下载上传)。

找到纯兆帆服务器上的位置/etc/my.cnf,并下载一份备份在本地(后面还用,留一份原版的不要动)。

用Notepadd++打开my.cnf文件,在[mysqld]的段中加上一句:skip-grant-tables 例如: [mysqld] datadir=/var/lib/mysql skip-grant-tables 保存

将修改过的my.cnf上传到阿里云服务器上原来的做雹位置覆盖旧的文件。

通过命令窗口,重新启动mysql # /etc/init.d/mysql restart

成功后,窗口反馈:

Stopping MySQL: [ OK ] Starting MySQL: [ OK ]

接下来,还是在命令窗口,进入mysql;输入

mysql USE mysql ;

mysql UPDATE user SET Password = password ( 'new-password' ) WHERE User = 'root' ;

完成

退出mysql。

命令窗口 mysql quit 回车

7

将最初备份的原始my.cnf重新上传并覆盖服务器上的文件。/etc/my.cnf (skip-grant-tables删除 )最后重新启动mysqld # /etc/init.d/mysqld restart

输入mysql -u root -p就会提示输入新密码,猜神输入刚才设置的秘密就可以进去,说明设置成功。

阿里云轻量级服务器常用命令备忘

最近使用阿里云轻量级洞燃服务器,将常用命令列出来备忘。

mysql服务器重闷渣启:使用sudo su root切换到root用户,执行/etc/init.d/mysqld start

查看系统信息:cat /etc/os-release

mysql日志位置:/usr/local/mysql/data目录下,err后缀文件。可以使用winscp查询。

mysql服务器登蚂颤悄录:/usr/local/mysql/bin/mysql -u root -p

启动、查看、停止服务:

sudo systemctl start kestrel-zldnnapp.service

sudo systemctl status kestrel-zldnnapp.service

sudo systemctl stop kestrel-zldnnapp.service

上一篇:阿里邮箱入口(阿里邮箱登录首页)
下一篇:gpu云服务器软件(gpu云服务器哪家便宜)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~