❶ mysql数据库在linux上的不同登录方式和权限
1.
mysql数据库
,忘记root
用户登录
密码。
解决如下:
a.重置密码
#/etc/init.d/mysqld
stop
#mysqld_safe
--user=mysql
--skip-grant-tables
--skip-networking
&
#mysql
-u
root
mysql
mysql>
UPDATE
user
SET
Password=PASSWORD('newpassword')
where
USER='root';
mysql>
FLUSH
PRIVILEGES;
mysql>
quit;
b.使用新密码登录
#mysql
-u
root
-pnewpassword
2.远程登录权限
mysql>
GRANT
ALL
PRIVILEGES
ON
*.*
TO
'myuser'@'%'
IDENTIFIED
BY
'mypassword'
WITH
GRANT
OPTION;
mysql>
FLUSH
PRIVILEGES;
上面授权是允许myuser用户,从任何机器都能访问mysql服务器。
%代表任何客户端,也可以是
localhost
,或者是某一ip地址。
❷ 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 如何查看用户与数据库之间的权限关系
bin目录是mysql控制程序所在的目录,比如mysql的启动,mysql的备份命令都在这个目录下面。数据库肯定要有一个用户
,这个用户就是user,对应的密码就password。后面的name就是生成的备份文件名。
❹ linux中安装mysql,如何开启远程访问权限
1、登陆mysql
mysql -u root -p
2、改表法:修改mysql库的user表,将host项,从localhost改为%。%这里表示的是允许任意host访问,如果只允许某一个ip访问,则可改为相应的ip,比如可以将localhost改为192.168.1.123,这表示只允许局域网的192.168.1.123这个ip远程访问mysql。
mysql> USE MYSQL;mysql> UPDATE USER SET host = '%' WHERE user = 'root';
3、授权法:
mysql> USE MYSQL;mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION //赋予任何主机访问以及修改所有数据的权限 例如,你想root用户使用root从任何主机连接到mysql服务器的话。GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;如果你想允许用户root从ip为192.168.1.123的主机连接到mysql服务器,并使用root作为密码GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.123'IDENTIFIED BY 'root' WITH GRANT OPTION;mysql> FLUSH PRIVILEGES //
❺ Linux下MYSQL 数据库权限问题如何解决
那就是数据库权限的问题,而不是linux,数据库是分权限滴,有的可读,有的可写,有的只让你读某个表。。。。总之数据库也是权限严格,确认你是账号密码没问题?如果是最高权限无法进入,建议重新安装(如果没数据的话)。
去看看lamp相关教程!弄个phpmyadmin,可视化,就像mssql那么简单处理!
❻ 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怎么给oracle中用户权限
--//给用户授予权限
grant connect,resource to test;
--//删除表空间
drop tablespace test_temp including CONTENTS and datafiles;
--//修改用户密码
alter user test identified by new_password;
--//删除用户
drop user 用户名 cascade; --//执行该语句请小心,会级联删除该用户下所有对象。
--//给用户分配权限
SQL> grant connect to test_user;
SQL> grant resource to test_user;
SQL> grant create view to test_user;
SQL> GRANT DEBUG CONNECT SESSION TO test_user;
SQL> GRANT DEBUG ANY PROCEDURE TO test_user;
实例如下:
数据库用户的创建、权限的分配
数据库安装完成后,有两个系统级的用户:
1、system 默认密码为:manager
2、sys 默认密码为:change_on_install
在安装的数据库目录中找到\oracle\proct\9.2\bin 中的sqlplus程序,运行:./sqlplussystem/manager@ora9i
用system用户创建自己的用户、权限;sql语句如下:
1、创建用户:
create user username identified by pwd default tablespace users Temporary TABLESPACE Temp;
2、用户授权
grant connect,resource,dba to business;
3、提交
commit;
❽ 怎样设置linux上db2数据库的远程访问权限
DB2连接远程数据库实例的步骤 一: 开始菜单--------运行--------输入地db2cmd地,进入DB2命令行处理器,如下图: 二:输入地db2地,进入命令处理状态,如下图: 三:输入 CATALOG TCPIP NODE nodeone REMOTE 192.9.107.64 SERVER 50000 remote_instance db2admin 注:其中nodeone为自己取的节点名称,192.9.107.64为远程数据库的IP地址,db2admin为远程数据库的实例.结果如下: 四:输入 CATALOG DB RONESERV AS testdb AT NODE nodeone 注:其中RONESERV为远程数据库的名称,testdb为该远程数据库在本地机器上的别名,nodeone为步骤三中我们建立的节点名称 五:此时即可像操作本地数据库一样操作远程数据库了,输入: connect to testdb user db2admin using lianxi 注:其中testdb为我们在步骤四中为远程数据库指定的别名,db2admin为远程数据库的用户名,lianxi为远程数据库的密码 此时您可看到,DB2的控制中心能像操作本地数据库一样操作远程数据库了.
❾ linux下,新增一个用户并赋予连接数据库权限是什么命令
命令行下
useradd -g 你的数据库用户组名 你的用户名
这样你的用户名就有权限使用数据库了。
数据库用户组 可以 group -l 看看。