(centos6 5)MySQL服務安裝

2021-10-09 04:06:05 字數 2403 閱讀 3958

安裝mysql服務,在資料庫建表,增刪資料等

centos 6.5 server 192.168.80.66 網路源

[root@localhost ~]# service mysqld start //啟動服務

[root@localhost ~]# grep 「password」 /var/log/mysqld.log

//檢視是否建立了密碼

[root@localhost ~]# mysqladmin -u root password 『123』

//重設資料庫管理員密碼

[root@localhost ~]# mysql -uroot -p123

welcome to the mysql monitor. commands end with ; or \g.

our mysql connection id is 3

server version: 5.1.73 source distribution

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> create database if not exists lsy;

query ok, 1 row affected (0.00 sec)

mysql> show databases;

| database |

| information_schema |

| lsy |

| mysql |

| test |

4 rows in set (0.01 sec)

mysql> use lsy //使用lsy資料庫

database changed

mysql> create table lsy(id int(11) not null,name varchar(100) not null,age tinyint(1) null);

query ok, 0 rows affected (0.02 sec)

mysql> desc student;

| field | type | null | key | default | extra |

| id | int(11) | no | | null | |

| name | varchar(100) | no | | null | |

| age | tinyint(1) | yes | | null | |

3 rows in set (0.01 sec)

mysql> show databases;

| database |

| information_schema |

| lsy |

| mysql |

| test |

mysql> insert into lsy

-> (id,name,age)

-> values

-> (「1」,「阿雷」,「6」);

mysql> select * from lsy;

| id | name | age |

| 1 | 阿雷 | 6 |

1 row in set (0.00 sec)

mysql> select name from lsy;

| name |

| 阿雷 |

1 row in set (0.00 sec)

mysql> update lsy set age=「68」 where age=6;

query ok, 1 row affected (0.00 sec)

rows matched: 1 changed: 1 warnings: 0

mysql> select * from lsy

| id | name | age |

| 1 | 阿雷 | 68 |

1 row in set (0.00 sec)

mysql> drop database lsy;

query ok, 0 rows affected (0.00 sec)

mysql> show databases;

| database |

| information_schema |

| mysql |

| test |

3 rows in set (0.00 sec)

《Centos6 5 MYSQL原始碼安裝》

工作流程 客戶 市場部 開發 測試 運營 運維 職位 網路運維工程師 系統運維工程師 虛擬化運維工程師 資料庫運維工程師 自動化運維工程師 運維開發工程師 mysql安裝包 yum y install gcc gcc c bison ncurses ncurses devel boost cmake...

centos6 5 mysql忘記登入密碼

1.修改檔案目錄為 etc my.cnf的檔案 在 mysqld 的段中加上一句 skip grant tables,儲存檔案重啟資料庫 例如 mysqld skip grant tables datadir var lib mysql socket var lib mysql mysql.sock...

Centos6 5搭建dhcpd服務

dhcpd動態獲取ip位址,對於小型區域網很便利的。在不大的網路社會靜態ip也是不錯的!環境 centos6.5 10.10.24.1 dns server winxp sp3 client 網段 10.10.24.0 24 01 設定主機名 hostname dns.mvpbang.com vim...