第一篇:MySQL的管理員用戶名為root
MySQL的管理員用戶名為root,密碼默認為空
修改root密碼
MySQL配置好后,啟動成功,默認密碼是空,但是為了安全,設置密碼(MySQL有一個默認用戶名為root,密碼自己設定:假如設為root)。
1)登錄MySQL root用戶:
打開命令行,執行:
Mysql代碼
? mysql-uroot-p
2)修改root密碼:
Mysql代碼
? ? mysql> update mysql.user set password=“root” where User=“root”;mysql> flush privileges;
修改該修改密碼的語句:update mysql.user set password=“root” where User=“root”;
為: update mysql.user set password=password(“root”)where User=“root”;
詳細說明:見最底下的補充說明。
以后再進入MySQL,則為:
Mysql代碼
? mysql-uroot-proot
7、常用命令:
Mysql代碼
? show databases;--顯示數據庫 ? ? ? ? use databasename;--用數據庫
show tables;--顯示表
create table tablename(field-name-1 fieldtype-1 modifiers,field-name-2 alter table tablename add new-fielname new fieldtype--為表加入新列 fieldtype-2 modifiers,....);--創建表 ?? insert into tablename(fieldname-1,fieldname-2,fieldname-n)valuse(value-1,value-2,value-n)--增
?? delete from tablename where fieldname=value--刪
?? update tablename set fieldname=new-value where id=1--改
?? select * from tablename--查 ?? desc tablename--表定義描述
?? show create table tablename--可以查看引擎
?? alter table tablename engine=InnoDB--修改引擎
?? create table tablename(id int(11),name varchar(10))type=INNODB--建表是設置引擎
8、例如:
(1)登錄MySQL服務器后,查看當前時間,登錄的用戶以及數據庫的版本
Mysql代碼
?? mysql> select now(),user(),version();
?? +---------------------+----------------+-----------+ ?? | now()| user()| version()| ?? +---------------------+----------------+-----------+ ?? | 2012-02-26 20:29:51 | root@localhost | 5.5.20 | ?? +---------------------+----------------+-----------+ ?? 1 row in set(0.00 sec)
(2)顯示數據庫列表
Mysql代碼
?? mysql> show databases;?? +--------------------+ ?? | Database | ?? +--------------------+ ?? | information_schema | ?? | mysql | ?? | performance_schema | ?? | test | ?? +--------------------+ ?? 4 rows in set(0.03 sec)
(3)新增數據庫并查看
Mysql代碼
?? mysql> create database test_db;?? Query OK, 1 row affected(0.00 sec)??
?? mysql> show databases;?? +--------------------+ ?? | Database | ?? +--------------------+ ?? | information_schema | ?? | mysql | ?? | performance_schema | ?? | test | ?? | test_db | ?? +--------------------+ ?? 5 rows in set(0.00 sec)
(4)選擇數據庫
Mysql代碼
?? mysql> use test_db;?? Database changed
查看已選擇的數據庫:
Mysql代碼
?? mysql> select database();?? +------------+ ?? | database()| ?? +------------+ ?? | test_db | ?? +------------+
?? 1 row in set(0.00 sec)
(5)顯示當前數據庫的所有數據表
Mysql代碼
?? mysql> show tables;?? Empty set(0.00 sec)
(6)新建數據表并查看
Mysql代碼
?? mysql> create table person(??-> id int,??-> name varchar(20), ??-> sex char(1), ??-> birth date ??->);
?? Query OK, 0 rows affected(0.09 sec)
Mysql代碼
?? mysql> show tables;?? +-------------------+ ?? | Tables_in_test_db | ?? +-------------------+ ?? | person | ?? +-------------------+ ?? 1 row in set(0.00 sec)
(7)獲取表結構
Mysql代碼
?? mysql> desc person;
?? +-------+-------------+------+-----+---------+-------+ ?? | Field | Type | Null | Key | Default | Extra | ?? +-------+-------------+------+-----+---------+-------+ ?? | id | int(11)| YES | | NULL | | ?? | name | varchar(20)| YES | | NULL | | ?? | sex | char(1)| YES | | NULL | | ?? | birth | date | YES | | NULL | | ?? +-------+-------------+------+-----+---------+-------+ ?? 4 rows in set(0.01 sec)
或者
Mysql代碼
?? mysql> describe person;
?? +-------+-------------+------+-----+---------+-------+ ?? | Field | Type | Null | Key | Default | Extra | ?? +-------+-------------+------+-----+---------+-------+ ?? | id | int(11)| YES | | NULL | | ?? | name | varchar(20)| YES | | NULL | | ?? | sex | char(1)| YES | | NULL | | ?? | birth | date | YES | | NULL | | ?? +-------+-------------+------+-----+---------+-------+ ?? 4 rows in set(0.01 sec)
(8)查詢表中的數據
Mysql代碼
?? mysql> select * from person;?? Empty set(0.00 sec)
(9)插入數據
Mysql代碼
?? mysql> insert into person(id,name,sex,birth)??-> values(1,'zhangsan','1','1990-01-08');?? Query OK, 1 row affected(0.04 sec)
查詢表中的數據:
Mysql代碼
?? mysql> select * from person;
??? +------+----------+------+------------+ ??? | id | name | sex | birth | ??? +------+----------+------+------------+ ??? | 1 | zhangsan | 1 | 1990-01-08 | ??? +------+----------+------+------------+ ??? 1 row in set(0.00 sec)
(10)修改字段的類型
Mysql代碼
??? mysql> alter table person modify sex char(8);??? Query OK, 1 row affected(0.17 sec)??? Records: 1 Duplicates: 0 Warnings: 0
查看字段描述:
Mysql代碼
??? mysql> desc person;
??? +-------+-------------+------+-----+---------+-------+ ??? | Field | Type | Null | Key | Default | Extra | ??? +-------+-------------+------+-----+---------+-------+ ??? | id | int(11)| YES | | NULL | | ??? | name | varchar(20)| YES | | NULL | | ??? | sex | char(8)| YES | | NULL | | ??? | birth | date | YES | | NULL | | ??? +-------+-------------+------+-----+---------+-------+ ??? 4 rows in set(0.01 sec)
(11)新增一個字段
Mysql代碼
??? mysql> alter table person add(address varchar(50));??? Query OK, 1 row affected(0.27 sec)??? Records: 1 Duplicates: 0 Warnings: 0
查看字段描述:
Mysql代碼
??? mysql> desc person;
??? +---------+-------------+------+-----+---------+-------+ ??? | Field | Type | Null | Key | Default | Extra | ??? +---------+-------------+------+-----+---------+-------+ ??? | id | int(11)| YES | | NULL | | ??? | name | varchar(20)| YES | | NULL | | ??? | sex | char(8)| YES | | NULL | | ??? | birth | date | YES | | NULL | | ??? | address | varchar(50)| YES | | NULL | | ??? +---------+-------------+------+-----+---------+-------+ ??? 5 rows in set(0.01 sec)
(12)更新字段內容
查看修改前表的內容:
Mysql代碼
??? mysql> select * from person;
??? +------+----------+------+------------+---------+ ??? | id | name | sex | birth | address | ??? +------+----------+------+------------+---------+ ??? | 1 | zhangsan | 1 | 1990-01-08 | NULL | ??? +------+----------+------+------------+---------+ ??? 1 row in set(0.00 sec)
修改:
Mysql代碼
??? mysql> update person set name='lisi' where id=1;??? Query OK, 1 row affected(0.04 sec)??? Rows matched: 1 Changed: 1 Warnings: 0
???
??? mysql> select * from person;
??? +------+------+------+------------+---------+ ??? | id | name | sex | birth | address | ??? +------+------+------+------------+---------+ ??? | 1 | lisi | 1 | 1990-01-08 | NULL | ??? +------+------+------+------------+---------+ ??? 1 row in set(0.00 sec)???
??? mysql> update person set sex='man',address='China' where id=1;??? Query OK, 1 row affected(0.04 sec)??? Rows matched: 1 Changed: 1 Warnings: 0
???
??? mysql> select * from person;
??? +------+------+------+------------+---------+ ??? | id | name | sex | birth | address | ??? +------+------+------+------------+---------+ ??? | 1 | lisi | man | 1990-01-08 | China | ??? +------+------+------+------------+---------+ ??? 1 row in set(0.00 sec)
為了方便下面測試刪除數據,在向person表中插入2條數據:
Mysql代碼
??? mysql> insert into person(id,name,sex,birth,address)???-> values(2,'wangwu','man','1990-01-10','China');??? Query OK, 1 row affected(0.02 sec)???
??? mysql> insert into person(id,name,sex,birth,address)???-> values(3,'zhangsan','man','1990-01-10','China');??? Query OK, 1 row affected(0.04 sec)???
??? mysql> select * from person;
??? +------+----------+------+------------+---------+ ??? | id | name | sex | birth | address | ??? +------+----------+------+------------+---------+ ??? | 1 | lisi | man | 1990-01-08 | China | ??? | 2 | wangwu | man | 1990-01-10 | China | ??? | 3 | zhangsan | man | 1990-01-10 | China | ??? +------+----------+------+------------+---------+ ??? 3 rows in set(0.00 sec)
(13)刪除表中的數據
刪除表中指定的數據:
Mysql代碼
??? mysql> delete from person where id=2;??? Query OK, 1 row affected(0.02 sec)???
??? mysql> select * from person;
??? +------+----------+------+------------+---------+ ??? | id | name | sex | birth | address | ??? +------+----------+------+------------+---------+ ??? | 1 | lisi | man | 1990-01-08 | China | ??? | 3 | zhangsan | man | 1990-01-10 | China | ??? +------+----------+------+------------+---------+ ??? 2 rows in set(0.00 sec)
刪除表中全部的數據:
Mysql代碼
??? mysql> delete from person;
??? Query OK, 2 rows affected(0.04 sec)???
??? mysql> select * from person;??? Empty set(0.00 sec)
(14)重命名表
查看重命名前的表名:
Mysql代碼
??? mysql> show tables;??? +-------------------+ ??? | Tables_in_test_db | ??? +-------------------+ ??? | person | ??? +-------------------+ ??? 1 row in set(0.00 sec)
重命名:
Mysql代碼
??? mysql> alter table person rename person_test;??? Query OK, 0 rows affected(0.04 sec)???
??? mysql> show tables;??? +-------------------+ ??? | Tables_in_test_db | ??? +-------------------+ ??? | person_test | ??? +-------------------+ ??? 1 row in set(0.00 sec)
(15)新增主鍵
Mysql代碼
??? mysql> alter table person_test add primary key(id);??? Query OK, 0 rows affected(0.11 sec)??? Records: 0 Duplicates: 0 Warnings: 0 ???
??? mysql> desc person_test;
??? +---------+-------------+------+-----+---------+-------+ ??? | Field | Type | Null | Key | Default | Extra | ??? +---------+-------------+------+-----+---------+-------+ ??? | id | int(11)| NO | PRI | 0 | | ??? | name | varchar(20)| YES | | NULL | | ??? | sex | char(8)| YES | | NULL | | ??? | birth | date | YES | | NULL | | ??? | address | varchar(50)| YES | | NULL | | ??? +---------+-------------+------+-----+---------+-------+ ??? 5 rows in set(0.00 sec)
刪除主鍵:
Mysql代碼
??? mysql> alter table person_test drop primary key;??? Query OK, 0 rows affected(0.18 sec)??? Records: 0 Duplicates: 0 Warnings: 0
???
??? mysql> desc person_test;
??? +---------+-------------+------+-----+---------+-------+ ??? | Field | Type | Null | Key | Default | Extra | ??? +---------+-------------+------+-----+---------+-------+ ??? | id | int(11)| NO | | 0 | | ??? | name | varchar(20)| YES | | NULL | | ??? | sex | char(8)| YES | | NULL | | ??? | birth | date | YES | | NULL | | ??? | address | varchar(50)| YES | | NULL | | ??? +---------+-------------+------+-----+---------+-------+ ??? 5 rows in set(0.01 sec)
(16)刪除表
Mysql代碼
??? mysql> drop table person_test;??? Query OK, 0 rows affected(0.04 sec)???
??? mysql> show tables;??? Empty set(0.00 sec)
(17)刪除數據庫
Mysql代碼
??? mysql> show databases;??? +--------------------+ ??? | Database | ??? +--------------------+ ??? | information_schema | ??? | mysql | ??? | performance_schema | ??? | test | ??? | test_db | ??? +--------------------+ ??? 5 rows in set(0.00 sec)???
??? mysql> drop database test_db;??? Query OK, 0 rows affected(0.11 sec)???
??? mysql> show databases;??? +--------------------+ ??? | Database | ??? +--------------------+ ??? | information_schema | ??? | mysql | ??? | performance_schema | ??? | test | ??? +--------------------+ ??? 4 rows in set(0.00 sec)
(18)查看建表語句 Mysql代碼
??? mysql> show create table table_name;
補充說明:
update mysql.user set password=“root” where User=“root”;修改的不是密碼,如果按照這個方式修改了,重新登錄時將會報錯:
Mysql代碼
??? mysql> update mysql.user set password=“root” where User=“root”;??? Query OK, 3 rows affected(0.00 sec)??? Rows matched: 3 Changed: 3 Warnings: 0 ???
??? mysql> exit ??? Bye ???
??? C:Usersliqiong>mysql-uroot-p ??? Enter password: ****
??? ERROR 1045(28000): Access denied for user 'root'@'localhost'(using password: Y ??? ES)
請按照以下方式重新修改密碼,即可登錄成功:
Mysql代碼
??? C:Usersliqiong>mysql-uroot
??? Welcome to the MySQL monitor.Commands end with;or g.??? Your MySQL connection id is 4
??? Server version: 5.5.20 MySQL Community Server(GPL)???
??? Copyright(c)2000, 2011, 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> update mysql.user set password=password(“root”)where User=“root”;??? Query OK, 3 rows affected(0.00 sec)??? Rows matched: 3 Changed: 3 Warnings: 0 ???
??? mysql> flush privileges;
??? Query OK, 0 rows affected(0.00 sec)???
??? mysql> exit ??? Bye ???
??? C:Usersliqiong>mysql-uroot-p ??? Enter password: ****
??? Welcome to the MySQL monitor.Commands end with;or g.??? Your MySQL connection id is 5
??? Server version: 5.5.20 MySQL Community Server(GPL)???
??? Copyright(c)2000, 2011, 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>
第二篇:管理員用戶與標準用戶簡介以及區
管理員用戶與標準用戶簡介以及區
帳戶有以下三種不同類型:
標準用戶
管理員用戶
來賓用戶
每種帳戶類型為用戶提供不同的計算機控制級別。標準帳戶是日常計算機使用中所使用的帳戶。管理員帳戶對計算機擁有最高的控制權限,微軟建議僅在必要時才使用此帳戶。來賓帳戶主要供需要臨時訪問計算機的用戶使用。
標準用戶
標準用戶帳戶允許用戶使用計算機的大多數功能,但是如果要進行的更改會影響計算機的其他用戶或安全,則需要管理員的許可。
Vista系統中使用標準帳戶時,可以使用計算機上安裝的應用程序,但是無法安裝或卸載硬件驅動,也無法刪除計算機運行所必需的系統文件或者更改計算機上會影響其他用戶的設置。如果使用的是標準帳戶,則某些程序可能要求提供管理員密碼后才能執行。
XP系統中無法安裝軟件或硬件,但可以訪問已經安裝在計算機上的程序;可以更改其帳戶圖片,還可以創建、更改或刪除其密碼;無法更改其帳戶名或者帳戶類型。使用計算機管理員帳戶的用戶必須進行這些類型的更改。同樣,某些程序可能要求提供管理員密碼后才能執行。
管理員用戶
管理員組的成員具有更改自己的權限的最大限度默認權限和能力。管理員帳戶就是允許您進行將影響其他用戶的更改的用戶帳戶。管理員可以更改安全設置,安裝軟件和硬件,訪問計算機上的所有文件。管理員還可以對其他用戶帳戶進行更改。
設置 Windows 時,將要求您創建用戶帳戶。此帳戶就是允許您設置計算機以及安裝您想使用的所有程序的管理員帳戶。完成計算機設置后,建議您使用標準用戶帳戶進行日常的計算機使用。使用標準用戶帳戶比使用管理員帳戶更安全。
該用戶有以下幾種主要功能:
可以創建和刪除計算機上的用戶帳戶。
可以為計算機上其他用戶帳戶創建帳戶密碼。
可以更改其他人的帳戶名、圖片、密碼和帳戶類型。
無法將自己的帳戶類型更改為受限制帳戶類型,除非至少有一個其他用戶在該計算機上擁有計算機管理員帳戶類型。這樣可以確保計算機上總是至少有一個人擁有計算機管理員帳戶。
來賓用戶
來賓組允許偶爾或臨時用戶登錄計算機的內置來賓帳戶,并授予有限的能力。
來賓帳戶是供在計算機或域中沒有永久帳戶的用戶使用的帳戶。它允許人們使用計算機,但沒有訪問個人文件的權限。使用來賓帳戶的人無法安裝軟件或硬件,但可以訪問已經安裝在計算機上的程序;無法更改來賓帳戶類型;可以更改來賓帳戶圖片。
注意:系統必須打開來賓帳戶才可以使用它。
管理員用戶與標準用戶的區別
管理員用戶與標準用戶的區別就是權限不同,系統管理員有對計算機的完全訪問控制權。而標準用戶可修改大部分計算機設置,安裝不修改操作系統文件且不需要安裝系統服務的應用程序,創建和管理本地用戶帳戶和組,啟動或停止默認情況下不啟動的服務,但不可訪問NTFS分區上屬于其他用戶的私有文件。
當用戶登錄到計算機后,系統為該用戶創建一個訪問令牌。該訪問令牌包含有關授予給該用戶的訪問權限級別的信息,其中包括特定的安全標識符(SID)和 Windows 權限。
如果登錄用戶屬于管理員組,則Windows 為該用戶創建兩個單獨的訪問令牌:標準用戶訪問令牌和管理員訪問令牌。標準用戶訪問令牌包含的用戶特定信息與管理員訪問令牌包含的信息相同,但是已經刪除管理 Windows 權限和 SID,用于啟動不執行管理任務的應用程序。
第三篇:學校平臺管理員用戶和教師用戶操作參考指南
學校平臺管理員用戶操作參考指南 ..
操作一:
組織規劃并填寫學校用戶信息收集表(見通知附件中的電子表格),以便批量導入用戶之用。
注意:登錄名和密碼要統一填寫,登錄名建議由校名簡稱+人名的首拼音字母,但要注意不能重復。
操作二:
批量導入用戶。
1、用IE9.0以上版本或360瀏覽器,打開大豐市教育信息化公共服務平臺(ycdf.jse.edu.cn)
2、點擊平臺主頁右上角“登錄”
3、輸入學校平臺管理員用戶名、密碼(見通知附件),點擊“登錄”
4、如果是首次登錄,則要輸入昵稱(建議用學校全稱),點擊“保存”
5、點擊頁面右上角“管理”
6、點擊頁面左側“用戶管理”
7、點擊頁面中部身份欄“教職工”單選按鈕,再點擊其下面的“導入”
8、點擊批量導入用戶信息對話框中“本地文件”
9、打開操作一準備好的學校用戶信息收集表
10、等待數據分析完成后,點擊 “關閉”
(如果導入失敗,請按提示修改正確后,再次導入)操作三:告知教師的登錄名和密碼
說明:因平臺還在開發完善之中,當前我們主要做以上三個操作,其它更多的操作可參閱省平臺用戶操作手冊)
學校教師用戶操作參考指南 ..
1、打開大豐市教育信息化公共服務平臺
(ycdf.jse.edu.cn)
2、點擊平臺主頁右上角“登錄”
3、輸入用戶名、密碼(由學校管理員提供),點擊“登錄”
4、如是首次登錄,則要輸入昵稱(建議用學校簡稱+姓名),點擊“保存”,進入個人平臺頁面。
應用操作一:
在個人平臺頁面上瀏覽查閱有關欄目或專題,用于個人學習和教育教學。(重點是中部的“應用推送”欄中的“教師應用”)
應用操作二:
5、點擊頁面右上角“教師用戶名”(即教師用戶的昵稱)
6、點擊頁面左側“我的資源”
7、點擊頁面右側“上傳資源”
8、在新增資源頁面,填寫和選擇新增資源的基本信息后,點擊“上傳素材”
10、在素材制作頁面,點選 “文件上傳”,再點擊“上傳文件”
9、打開自己準備好的文件后,回到對話框,點擊“確定
10、再次回到新增資源頁面,點擊 “保存”。
說明:更多的操作(如修改個人用戶信息,完善上傳文件基本信息填寫和選擇等操作),請學校管理員參考省平臺用戶操作手冊,另行輔導。
第四篇:如何用超級用戶刪掉計算機管理員用戶?(模版)
如何用超級用戶刪掉計算
機管理員用戶?
方法一:在安全模式下,進入控制面板-用戶-刪除那個管理員用戶
方法
二、點“開始”--運行“lusrmgr.msc”--“用戶”刪除那個用戶
方法三:安全模式下,點“開始”--運行“lusrmgr.msc”--“用戶”刪除那個用戶
第五篇:WindowsXP無Administrator用戶(超級管理員)解決辦法(精選)
Windows-XP系統無Administrator(超級管理員)解決方法
1,我的電腦右鍵-?管理
如果不行,繼續做第二步
2開始--運行--regedit--打開注冊表編輯器--依次展開HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsNTCurrentVersionWinlogonSpecialAccountsUserList分支--將右邊的Administrator的值改為1(沒有就右鍵右邊空白處新建一個DOWN值,名字寫administrator),即可讓Administrator賬戶出現在登錄的歡迎屏幕上。