MySQL5.6连接与断开mysql的详细方法

下面讲讲关于MySQL5.6连接与断开mysql的详细方法,文字的奥妙在于贴近主题相关。所以,闲话就不谈了,我们直接看下文吧,相信看完MySQL5.6连接与断开mysql的详细方法这篇文章你一定会有所受益。
3.1Connecting to and Disconnecting from the Server3.1连接和断开与云服务器的连接
To connect to the server, you will usually need to provide a MySQL user name when you invokemysqland, most likely, a password. If the server runs on a machine other than the one where you log in, you will also need to specify a host name. Contact your administrator to find out what connection parameters you should use to connect (that is, what host, user name, and password to use). Once you know the proper parameters, you should be able to connect like this:
为了连接服务,你通常需要提供一个MySQL用户名,可能还需要密码。如果服务不在你所登陆的fu wu qish云服务器上运行,你还需要指定云服务器的主机名(或IP地址)。请与您的管理员联系,找出您应该使用哪些连接参数进行连接(即要使用的主机名,用户名和密码)。一旦你知道正确的参数,你应该可以这样连接:
shell>mysql-hhost-uuser-pEnterpassword:********hostanduserrepresent the host name where your MySQL server is running and the user name of your MySQL account. Substitute appropriate values for your setup. The********represents your password; enter it whenmysqldisplays theEnter password:prompt.
If that works, you should see some introductory information followed by amysql>prompt:
host和user 象征着MySQL云服务器的主机名和MySQL账户的用户名。为您的设置替换成适当的值。********代表你的密码;当mysql显示Enter password:提示时输入。
如果配置正确,你应该看到一些介绍性信息,然后是一个mysql>提示:
shell>mysql-hhost-uuser-pEnterpassword:********WelcometotheMySQLmonitor.Commandsendwith;or\g.YourMySQLconnectionidis25338toserverversion:5.6.38-standardType'help;'or'\h'forhelp.Type'\c'toclearthebuffer.mysql>Themysql>prompt tells you thatmysqlis ready for you to enter SQL statements.
If you are logging in on the same machine that MySQL is running on, you can omit the host, and simply use the following:
mysql>提示 告诉你MySQL已经准备好让您输入SQL语句了。
假如MySQL运行的云服务器与你登陆的设备是同一台,你可以省略主机名设置,只需使用以下命令:
shell>mysql-uuser-pIf, when you attempt to log in, you get an error message such asERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2), it means that the MySQL server daemon (Unix) or service (Windows) is not running. Consult the administrator or see the section ofChapter2,Installing and Upgrading MySQLthat is appropriate to your operating system.
For help with other problems often encountered when trying to log in, seeSectionB.5.2, “Common Errors When Using MySQL Programs”.
Some MySQL installations permit users to connect as the anonymous (unnamed) user to the server running on the local host. If this is the case on your machine, you should be able to connect to that server by invokingmysqlwithout any options:
如果您尝试登录时会收到错误消息(如ERROR 2002(HY000)):无法通过套接字'/tmp/mysql.sock'(2)连接到本地MySQL云服务器,这意味着MySQL云服务器守护进程(Unix)或服务(Windows)未运行。请咨询管理员或参阅第2章适用于您的操作系统的安装和升级MySQL部分。
有关尝试登录时经常遇到的其他问题的帮助,请参见第B.5.2节“使用MySQL程序时的常见错误”。
一些MySQL安装允许用户作为匿名(未命名)用户连接到在本地主机上运行的云服务器。如果您的机器是这种情况,您应该能够通过调用mysql连接到该云服务器,而不需要任何选项:
shell>mysqlAfter you have connected successfully, you can disconnect any time by typingQUIT(or\q) at themysql>prompt:
连接成功后,您可以通过在提示符下键入QUIT(或\q)断开连接mysql>:
mysql>QUITByeOn Unix, you can also disconnect by pressing Control+D.
Most examples in the following sections assume that you are connected to the server. They indicate this by themysql>prompt.
在Unix上,也可以通过按Control + D断开连接。
以下部分中的大多数示例假定您已连接到云服务器。他们通过mysql>提示来表示这一点。
对于以上MySQL5.6连接与断开mysql的详细方法相关内容,大家还有什么不明白的地方吗?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值