linuxmysql許可權
❶ linux 下 Mysql 對目錄沒有訪問許可權,怎麼改
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 兩個數據列的許可權。