linuxmysql权限
1。 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -pvmwaremysql>use mysql;mysql>update user set host = '%' where user = 'root';mysql>select host, user from user;
2. 授权法。例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
我的mysql.user里root用户的host果然是localhost,先用改表法给localhost改成“%”,还是不行,仍然报1130的错 误,又按“从任何主机连接到mysql服务器”方法授权,还是报一样的错,最后给自己的ip授权之后,终于登录上了。。。。
❷ windows和Linux下的mysql授权表设置攻略
在Windows中,当mysql安装完成之后不需要创建数据目录和授权表。在数据目录下的MySQL数据库中存在一套预初始化的'账户的授权表。不要运行Unix中使用的mysql_install_db脚本。
在Unix上安装MySQL后,需要初始化授权表、启动服务器,并确保服务器工作正常。并为授权表中的账户指定密码。
在Unix中,由mysql_install_db设置授权表。
如果系统为安装好的CentOS5,则只需要运行
# mysql_install_db --user=mysql --datadir=/var/lib/mysql_ndbd/
一定要确保由mysql登录账户拥有数据库目录和文件,以便在以后运行服务器具有读、写访问权限。
当然,也可以以
mysqld_safe --user=mysql --skip-grant-tables & 跳过授权表来登录,登录进去重新赋权限,同时更新权限表:flush privileges
❸ 修改linux中mysql上存在的用户权限
一、KILL掉系统里的MySQL进程
php">killall-TERMmysqld
二、用以下命令启动MySQL,以不检查权限的方式启动
safe_mysqld–skip-grant-tables&
三、用空密码方式使用root用户登录 MySQL
mysql-uroot
四、修改root用户的密码
mysql>updatemysql.usersetpassword=PASSWORD(‘新密码’)whereUser=’root’;
mysql>flushprivileges;
mysql>quit
❹ linux mysql 数据库权限
hi 楼主,在数据库中创建包含很多,视图,索引,临时表的创建权限都能分开赋予,你可以执行 show privileges 来查看权限参数,我这边就以创建表为例,只包含查询表功能,其他修改,删除,备份没有权限;以下是步骤:
1,create user 'tom'@'%' identified by '123456';---创建用户,无权限;
2, grant create,select on wangxh2.* to tom;-----把wangxh2库的所有表的创建和查询赋予tom
3,flush privileges;-----刷新权限表才能起效
接下来是测试:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
| wangxh2 |
+--------------------+
3 rows in set (0.06 sec)
mysql> use wangxh2
Database changed
mysql> show tables;
+-------------------+
| Tables_in_wangxh2 |
+-------------------+
| test |
+-------------------+
1 row in set (0.00 sec)
mysql> drop test;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'test' at line 1
mysql> drop table test;
ERROR 1142 (42000): DROP command denied to user 'tom'@'localhost' for table 'test'
mysql> select count(*) from test;
+----------+
| count(*) |
+----------+
| 33554432 |
+----------+
1 row in set (0.01 sec)
mysql> insert into test values(1);
ERROR 1142 (42000): INSERT command denied to user 'tom'@'localhost' for table 'test'
mysql> delete from test;
ERROR 1142 (42000): DELETE command denied to user 'tom'@'localhost' for table 'test'
mysql> update test set id=1;
ERROR 1142 (42000): UPDATE command denied to user 'tom'@'localhost' for table 'test'
mysql> create table test1 (id int);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into test1 values(1);
ERROR 1142 (42000): INSERT command denied to user 'tom'@'localhost' for table 'test1'
[mysql@localhost ~]$ mysqlmp -u tom -paidengshan wangxh2 >/home/mysql/aa.sql
mysqlmp: Got error: 1044: Access denied for user 'tom'@'%' to database 'wangxh2' when using LOCK TABLES
[mysql@localhost ~]$
-----------------------------------------------------------------------------------------
以上测试发现,tom对wangxh2有建表,查询表的权限,但是修改,删除,新增,备份都没有权限,达到你的需求了
❺ linux下mysql 权限设置(sugarcrm)
不是mysql权限的问题 是你php文件和目录的权限问题。
chown root:root /path/to/sugarcrm/ -R
chmod 777 /path/to/sugarcrm/ -R
❻ linux用命令怎么修改mysql用户的权限
mysql更改用户权限
This entry was posted by admin Monday, 26 April, 2010
1.“grant all on *.* to root@’%’ identified by ‘yourpassword’;”——这个还可以顺带设置密码。
2.“flush privileges; ”——刷新一下,让权限生效。
mysql的一些其他的管理,可以用mysqladmin命令。可以用来设置密码什么的。
grant方面的详细信息可以看我下面的转载:
本文实例,运行于 MySQL 5.0 及以上版本。
MySQL 赋予用户权限命令的简单格式可概括为:
grant 权限 on 数据库对象 to 用户
一、grant 普通数据用户,查询、插入、更新、删除 数据库中所有表数据的权利。
grant select on testdb.* to common_user@’%’
grant insert on testdb.* to common_user@’%’
grant update on testdb.* to common_user@’%’
grant delete on testdb.* to common_user@’%’
或者,用一条 MySQL 命令来替代:
grant select, insert, update, delete on testdb.* to common_user@’%’
❼ linux 下mysql 服务无法开启
linux 下mysql 服务无法开启
1.可能是/usr/local/mysql/data/rekfan.pid文件没有写的权限
解决方法 :给予权限,执行 “chown -R mysql:mysql /var/data” “chmod -R 755 /usr/local/mysql/data” 然后重新启动mysqld!
2.可能进程里已经存在mysql进程
解决方法:用命令“ps -ef|grep mysqld”查看是否有mysqld进程,如果有使用“kill -9 进程号”杀死,然后重新启动mysqld!
3.可能是第二次在机器上安装mysql,有残余数据影响了服务的启动。
解决方法:去mysql的数据目录/data看看,如果存在mysql-bin.index,把它删除掉
❽ linux mysql 如何用户对某个表格的权限
对用户授权grant语句语法:
grant privileges (columns)
on what
to account
2.举例子:
grant all on zabbix.* to 'zabbix'@'localhost 给予'zabbix'@'localhost'管理zabbix这个数据库的全部权限。
grant select on zabbix.tmp to 'saladin'@'localhost' 给予'saladin'@'localhost'查询检索数据库zabbix里的tmp表格的权限。
grant select,update,delete (name,id) on zabbix.tmp to 'saladin'@'localhost' 给予'saladin'@'localhost'检索更新删除表格tmp里 name 和 id 两个数据列的权限。