新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
MySQL修改用戶(RENAMEUSER)
在 mysql 中,我們可以使用
RENAME USER 語句修改一個(gè)或多個(gè)已經(jīng)存在的用戶賬號(hào)。
RENAME USER 語句修改一個(gè)或多個(gè)已經(jīng)存在的用戶賬號(hào)。

創(chuàng)新互聯(lián)是專業(yè)的延安網(wǎng)站建設(shè)公司,延安接單;提供成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作,網(wǎng)頁設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行延安網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來合作!
語法格式如下:
RENAME USER <舊用戶> TO <新用戶>
其中:
- <舊用戶>:系統(tǒng)中已經(jīng)存在的 MySQL 用戶賬號(hào)。
- <新用戶>:新的 MySQL 用戶賬號(hào)。
使用 RENAME USER 語句時(shí)應(yīng)注意以下幾點(diǎn):
- RENAME USER 語句用于對(duì)原有的 MySQL 用戶進(jìn)行重命名。
- 若系統(tǒng)中舊賬戶不存在或者新賬戶已存在,該語句執(zhí)行時(shí)會(huì)出現(xiàn)錯(cuò)誤。
- 使用 RENAME USER 語句,必須擁有 mysql 數(shù)據(jù)庫的 UPDATE 權(quán)限或全局 CREATE USER 權(quán)限。
例 1
使用 RENAME USER 語句將用戶名 test1 修改為 testUser1,主機(jī)是 localhost。SQL 語句和執(zhí)行過程如下。
mysql> RENAME USER 'test1'@'localhost'
-> TO 'testUser1'@'localhost';
Query OK, 0 rows affected (0.03 sec)
在 cmd 命令行工具中,使用 testUser1 用戶登錄數(shù)據(jù)庫服務(wù)器,如下所示。
C:\Users\USER>mysql -h localhost -u testUser1 -p Enter password: ***** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 5.7.20-log MySQL Community Server (GPL) Copyright (c) 2000, 2017, 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修改用戶(RENAMEUSER)
網(wǎng)站路徑:http://m.fisionsoft.com.cn/article/dpedgeh.html


咨詢
建站咨詢
