ubuntu mysql 安装
来源:互联网 发布:mac如何彻底删除文件 编辑:程序博客网 时间:2024/05/21 00:19
安装
lychie@ubuntu:/setup$ sudo apt-get install mysql-server mysql-client
[sudo] password for lychie: ******
Reading package lists... Done
Building dependency tree
Reading state information... Done
. . . . . . . . . . . .
After this operation, 93.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
. . . . . . . . . . . .
[sudo] password for lychie: ******
Reading package lists... Done
Building dependency tree
Reading state information... Done
. . . . . . . . . . . .
After this operation, 93.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
. . . . . . . . . . . .
更改密码
mysql -uroot -p登录 MySQL,安装的时候没有设置密码,提示输入密码的时候直接回车就完事
lychie@ubuntu:/setup$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 42
Server version: 5.5.38-0ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 42
Server version: 5.5.38-0ubuntu0.14.04.1 (Ubuntu)
affiliates. Other names may be trademarks of their respective
owners.
update user set password=PASSWORD('******') where user='root';更改密码
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select host, user, password from user;
+-----------+------------------+--------------+
| host | user | password |
+-----------+------------------+--------------+
| localhost | root | |
| ubuntu | root | |
| 127.0.0.1 | root | |
| ::1 | root | |
| localhost | debian-sys-maint | ****** |
+-----------+------------------+--------------+
5 rows in set (0.00 sec)
mysql> update user set password=PASSWORD('******') where user='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
mysql> select host, user, password from user;
+-----------+------------------+--------------+
| host | user | password |
+-----------+------------------+--------------+
| localhost | root | ****** |
| ubuntu | root | ****** |
| 127.0.0.1 | root | ****** |
| ::1 | root | ****** |
| localhost | debian-sys-maint | ****** |
+-----------+------------------+--------------+
5 rows in set (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
mysql> select host, user, password from user;
+-----------+------------------+--------------+
| host | user | password |
+-----------+------------------+--------------+
| localhost | root | |
| ubuntu | root | |
| 127.0.0.1 | root | |
| ::1 | root | |
| localhost | debian-sys-maint | ****** |
+-----------+------------------+--------------+
5 rows in set (0.00 sec)
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
+-----------+------------------+--------------+
| host | user | password |
+-----------+------------------+--------------+
| localhost | root | ****** |
| ubuntu | root | ****** |
| 127.0.0.1 | root | ****** |
| ::1 | root | ****** |
| localhost | debian-sys-maint | ****** |
+-----------+------------------+--------------+
5 rows in set (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
启动 / 停止 MySQL
sudo stop mysql 停止 MySQL
sudo start mysql 启动 MySQL
sudo start mysql 启动 MySQL
0 0
- [mysql] ubuntu 安装 mysql
- [mysql]ubuntu安装mysql
- 【MySql】Ubuntu安装MySql
- MySQL-----Ubuntu安装MySQL
- ubuntu源码安装mysql
- Ubuntu安装配置Mysql
- ubuntu 9.04 安装 MySQL
- ubuntu MySQL安装指南
- ubuntu 下 MYSQL 安装
- Ubuntu 9.10 安装mysql
- ubuntu安装MySQL,Apache
- ubuntu 源码安装Mysql
- ubuntu 安装mysql apache
- ubuntu 安装 mysql
- Ubuntu安装Mysql
- ubuntu MySQL安装指南
- Ubuntu安装配置Mysql
- ubuntu MySQL安装指南
- 使用Pspice进行电路仿真
- OpenCV基础篇之图片叠加
- 循环的角度求均值
- OpenCV基础篇之使用CMake管理工程
- OpenCV基础篇之查找表
- ubuntu mysql 安装
- CentOS上编译安装OpenCV-2.3.1与ffmpeg-2.1.2
- OpenCV基础篇之读取显示图片
- OpenCV基础篇之像素操作对比度调节
- DSP/BIOS使用之初窥门径——滴答时钟及烧写Flash
- PCB设计资料:看到最后才知道是福利
- LabVIEW上位机与串口通信
- CentOS配置smaba与Windows共享文件
- 三极管的电平转换及驱动电路分析