1、首先,在你电脑桌面右键单击“此电脑”出现菜单栏,选择“属性”
2、点击进入属性页面(既系统面板)后,点击左边的“高级系统设置”
3、进入对话框,选择“计算机名”
4、点击计算机名页面下方的“更改”
5、在计算机名处填入新的计算机名,点击“确定”
6、由于更改计算机名,会影响对网络资源的访问,所以会d出一个对话框,确认是否需要更改计算机名,点击“确定”完成计算机名的更改
更改密码
1、mysql -u root -p
2、Enter password:***
3、mysql>use mysql #选择数据库
4、Database changed
5、mysql>UPDATE user SET password=PASSWORD("新密码") WHERE user='你的用户名'
6、mysql>FLUSH PRIVILEGES
7、mysql>quit
更改用户名:
1、mysql -u root -p
2、Enter password:***
3、mysql>use mysql #选择数据库
4、Database changed
5、mysql>update user set user="新用户名" where user="root"#将用户名为root的改为新用户名
6、mysql>flush privileges#刷新权限
7、mysql> exit
扩展资料:
mysql常用命令:
安装(基于centos)
yum -y install mariadb mariadb-server #centos7版本
yum -y install mysql mysql-server #centos7以下版本
启动
service mysqld start #开启 centos7以下版本
chkconfig mysqld on #设置开机自启
OR
systemctl start mariadb #centos7
systemctl enable mariadb
设置密码
1 、mysqladmin -u root -p123 password '1234' #修改root用户密码
2、进入mysql库修改user表
mysql>use mysql
mysql>update user set password=password('你的密码') where user='root'
mysql>flush privileges
登录
mysql #本地登录,默认用户root,空密码,用户为root@127.0.0.1
mysql -uroot -p1234 #本地登录,指定用户名和密码,用户为root@127.0.0.1
mysql -uroot P端口号 -h 192.168.31.95 -p密码 #远程登录,用户为root@192.168.31.95
查看
ps aux |grep mysqld #查看进程
netstat -an |grep 3306 #查看端口
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.6的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3'IDENTIFIED BY
'mypassword' WITH GRANT OPTION
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)