站内搜索: 请输入搜索关键词
当前页面: 图书首页 > MySQL Tutorial

MySQL Tutorial

[ Directory ] Previous Section Next Section

Creating an Account for Basic Use

It is usually a good idea to use some account other than root for basic day-to-day work for security reasons.

We will briefly cover how to create a separate account now. For full details of how user accounts work in MySQL, read Chapter 11, "Managing User Privileges."

Create an account for day-to-day use by typing the following:


grant create, create temporary tables, delete, execute, index, insert,
 lock tables, select, show databases, update
on *.*
to username identified by 'password';

Obviously, you should substitute your own username and password into this command.

You should now log out and log back in with the username and password you set. You will need to use a root account for some of the things we will do in the later chapters of this book, but this account we have just created has fewer privileges than root, so it is safer for day-to-day use.

    [ Directory ] Previous Section Next Section