phpmyadmin教程:使用phpmyadmin创建用户、数据库表的方法
phpmyadmin作为管理Mysql数据库的利器,越来越受到PHP网站开发建设者的欢迎,在此之前我介绍了两篇phpmyadmin入门教程:phpmyadmin3安装配置图解教程和允许phpmyadmin空密码登录的配置方法,今天继续phpmyadmin教程学习,介绍如何使用phpmyadmin创建添加新用户进行用户权限设置以及如何使用phpmyadmin创建数据库表的方法。
在使用phpmyadmin管理Mysql数据库之前,请确保Mysql服务已启动,即
1 |
net start mysql |
phpmyadmin教程:创建添加新用户及权限设置的使用方法
1、登入phpmyadmin管理首页,点击右侧上方权限菜单,会列出当前所有用户及用户权限级别,点击添加新用户链接即进入用户权限设置界面,可创建新用户
phpmyadmin创建添加新用户并进行权限设置教程
在登录信息中主要包含用户名、主机、密码三个选项,用户名选择任意用户或使用文本域选项本质没有什么区别,推荐选择使用文本域;如果不想设置用户密码可选无密码项
主机有四种选项:任意主机(%)、本地( localhost)、使用主机表(host)、使用文本域,分别表示匹配所有主机;仅限本地主机(自动填写为localhost);使用主机表表示以Mysql数据库中的host表中的数据替代,可不填,如果添了主机数据,则此选项无效;使用文本域表示自行填写主机信息。
特别说明:使用主机表非常有意思,如果你在mysql.host表中创建了一个host为127.0.0.1的主机,主机选择主机表,则你既可以以mysql_connect(”",”用户名”,”密码”)连接Mysql也可以以mysql_connect(”127.0.0.1″,”用户名”,”密码”)连接Mysql。
用户数据库一栏有三种选择,仅创建添加新用户、创建数据库并授予所有权限、给以用户名_ 开头的数据库 (username\_%) 授予所有权限,你可以根据Mysql数据库设计的需要自行选择,这里我选择无,即仅创建添加新用户。
创建新用户后,全局权限一栏显示USAGE表示此用户无权限,这是因为我们还没有对此用户进行权限设置,所以我们必须对创建的用户授权,点击权限菜单,对leapsoulcn用户点击编辑权限操作图标,如图
phpmyadmin用户权限设置详细信息
Mysql用户权限分为四种类型数据、结构、管理、资源限制,可根据需要自行设置或点击全选执行即可。
如想删除添加的新用户,只要勾选删除用户,点击添加新用户下的删除选中的用户右侧执行按钮即可,如图
phpmyadmin删除用户教程
如果在添加用户时选择了 创建与用户同名的数据库并授予所有权限 ,同时确实想删除此用户管理的数据库,可一并勾选删除与用户同名的数据库选项。
phpmyadmin教程:创建与修改数据库、数据表的使用方法
使用phpmyadmin创建数据库非常简单,phpmyadmin管理首页即有创建数据库的入口,如图
phpmyadmin创建数据库教程
此处我建立了数据库名为leapsoulcn的数据库,同时设定字符集为GBK,点击创建按钮即进入创建数据表管理界面
phpmyadmin创建数据表教程
填写数据表名及字段数,点击执行,即进入数据表字段管理界面
phpmyadmin创建数据表字段教程
使用phpmyadmin创建最基础的数据表主要关注字段、类型、长度/值、整理(字符集)、索引(PRIMARY\UNIQUE\INDEX\FULLTEXT)、A_I(AUTO_INCREMENT)、字段注释、表注释,创建表时请注意字符集统一,否则容易导致Mysql出现乱码。
如果想要使用phpmyadmin修改数据表结构,可点击右侧数据库,再点击结构菜单,会列出所选数据中的所有表信息,在操作一栏中选择结构操作即可。
如何使用phpmyadmin删除数据库或数据表?只要选择左侧相应数据库,再点击右侧上方红色的删除菜单,即代表删除数据库(DROP DATABASE),如果想要删除某张数据表(DROP TABLE),请选择左侧数据库后再选择左侧数据库列出的相应数据表后再点击删除菜单,请勿混淆,不同的层次,删除菜单代表的功能是不同的。
如想使用phpmyadmin修改已创建的数据库,选择左侧相应数据库后,点击操作菜单,如图
使用phpmyadmin修改数据库
你可使用phpmyadmin进行重命名数据库、创建数据表、修改数据库字符集等操作,简单实用。
phpmyadmin教程:用户对特定数据库的管理权限设置方法
使用phpmyadmin不但可以对全局用户权限进行设置,也可以针对某个数据库设置用户权限,但是在此之前请务必确保已对此用户进行了授权,否则对特定数据库的权限设置是无效的。
phpmyadmin权限设置入口有两种方式,一种是phpmyadmin主页权限菜单,一种是点击某个数据库,选择权限菜单,对相应的用户点击编辑权限操作进入权限设置界面
使用phpmyadmin对特定用户对特定数据库的权限进行设置
选择特定的数据,比如leapsoulcn数据库后会自动跳转到此数据库的用户权限设置界面
使用phpmyadmin对特定数据库权限进行设置
依此类推,在按表指定权限中选择相应的数据表即进入对特定表的权限设置界面,非常方便。
至此如何使用phpmyadmin创建用户并进行权限设置、如何使用phpmyadmin创建管理数据库表的phpmyadmin教程就介绍完了,今后将不断完善phpmyadmin使用教程,方便大家更好的使用phpmyadmin管理Mysql数据库。
注:PHP网站开发教程-leapsoul.cn版权所有,转载时请以链接形式注明原始出处及本声明,谢谢。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

Data Integration Simplification: AmazonRDSMySQL and Redshift's zero ETL integration Efficient data integration is at the heart of a data-driven organization. Traditional ETL (extract, convert, load) processes are complex and time-consuming, especially when integrating databases (such as AmazonRDSMySQL) with data warehouses (such as Redshift). However, AWS provides zero ETL integration solutions that have completely changed this situation, providing a simplified, near-real-time solution for data migration from RDSMySQL to Redshift. This article will dive into RDSMySQL zero ETL integration with Redshift, explaining how it works and the advantages it brings to data engineers and developers.

MySQL is suitable for beginners because it is simple to install, powerful and easy to manage data. 1. Simple installation and configuration, suitable for a variety of operating systems. 2. Support basic operations such as creating databases and tables, inserting, querying, updating and deleting data. 3. Provide advanced functions such as JOIN operations and subqueries. 4. Performance can be improved through indexing, query optimization and table partitioning. 5. Support backup, recovery and security measures to ensure data security and consistency.

To fill in the MySQL username and password: 1. Determine the username and password; 2. Connect to the database; 3. Use the username and password to execute queries and commands.

1. Use the correct index to speed up data retrieval by reducing the amount of data scanned select*frommployeeswherelast_name='smith'; if you look up a column of a table multiple times, create an index for that column. If you or your app needs data from multiple columns according to the criteria, create a composite index 2. Avoid select * only those required columns, if you select all unwanted columns, this will only consume more server memory and cause the server to slow down at high load or frequency times For example, your table contains columns such as created_at and updated_at and timestamps, and then avoid selecting * because they do not require inefficient query se

Navicat itself does not store the database password, and can only retrieve the encrypted password. Solution: 1. Check the password manager; 2. Check Navicat's "Remember Password" function; 3. Reset the database password; 4. Contact the database administrator.

Detailed explanation of database ACID attributes ACID attributes are a set of rules to ensure the reliability and consistency of database transactions. They define how database systems handle transactions, and ensure data integrity and accuracy even in case of system crashes, power interruptions, or multiple users concurrent access. ACID Attribute Overview Atomicity: A transaction is regarded as an indivisible unit. Any part fails, the entire transaction is rolled back, and the database does not retain any changes. For example, if a bank transfer is deducted from one account but not increased to another, the entire operation is revoked. begintransaction; updateaccountssetbalance=balance-100wh

View the MySQL database with the following command: Connect to the server: mysql -u Username -p Password Run SHOW DATABASES; Command to get all existing databases Select database: USE database name; View table: SHOW TABLES; View table structure: DESCRIBE table name; View data: SELECT * FROM table name;
