关于如何连接阿里云服务器上的MySQL数据库的解答
用 SSH客户端登录上以后
首先启动数据库:
[root@iZm5ec880z2rorZ ~]# service mysqld start可以输入一下加粗命令:
[root@iZm5ec880z2rorZ ~]# mysql -u root -pEnter 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 restartShutting down MySQL... [ OK ]
Starting MySQL. [ OK ]
本地java项目如何连接阿里云服务器上的mysql?
首先您需要保证您本地Java项目是可以联网的,然后在mysql的连接中输入阿里云服务器的地址以及数据库名和密码就行。
怎么将本地文件传到阿里云服务器里面
步骤一:
在本地电脑上,快捷键“WIN+R\"打开“运行”中输入“mstsc”,点击确定
步骤二:
在“远程桌面连接”框点击“显示选项”展开
步骤三:
在展开的“远程桌面连接”窗口,点击“本地资源”
计算机中输入阿里云ECS云服务器的IP地址
步骤四:
点击“详细信息”
步骤五:
勾选要上传阿里云ECS云服务器的文件所在的本地磁盘,点击确定
步骤六:
输入用户名和密码后连接上阿里云ECS云服务器,打开“我的电脑”,就可以看到勾选的本地磁盘映射的盘符
步骤七:
打开要上传文件所在路径,选择要上传的文件,复制后粘贴至阿里云ECS云服务器磁盘路径下,即可完成上传