MySQL資料庫伺服器常用基本資訊及操作

2021-09-11 04:12:37 字數 2075 閱讀 2375

以下資訊基於mysql 5.7

directory

contents of directory

binmysqld server, client and utility programs

data

log files, databases

docs

helper documents, like the release notes and build information

include

include (header) files

liblibraries

manunix manual pages

mysql-test

mysql test suite

share

miscellaneous support files, including error messages, sample configuration files, sql for database installation

support-files

scripts and sample configuration files

/tmp/mysql.sock

location of the mysql unix socket

shell> mysql -u root -p

enter password: (enter the random root password here)

然後設定新密碼
mysql> alter user 'root'@'localhost' identified by 'new_password'

;

$ mysql -u root --skip-password
然後設定密碼
mysql> alter user 'root'@'localhost' identified by 'new_password'

;

常用命令語句
$ sudo bin/mysqld_safe --user=mysql &
$ bin/mysqladmin -u root shutdown
$ bin/mysqladmin -u root -p version
$ mysqlshow -u root -p 

$ mysqlshow -u root -p scraping

$ mysql -h host -u user -p

# 如果伺服器在本機,則執行如下命令

$mysql -u user -p

mysql> quit

mysql資料庫伺服器基本資訊查詢

mysql> select version(); 

mysql> select now();

mysql> select user();

mysql> show databases;

mysql> select database();

mysql> use mydatabase;

mysql> create database menagerie;

mysql> show tables;

mysql> create table pet (name varchar(20), owner varchar(20), species varchar(20), *** char(1), birth date, death date)

;mysql> describe pet;

mysql> load data local infile '/path/pet.txt' into table pet;

mysql> insert into pet values (

'puffball','diane','hamster','f','1999-03-30',null)

;

mysql伺服器崩潰 mysql資料庫經常崩潰

mysql資料庫經常崩潰 雲伺服器 elastic compute service,簡稱ecs 是阿里雲提供的效能卓越 穩定可靠 彈性擴充套件的iaas infrastructure as a service 級別雲計算服務。雲伺服器ecs免去了您採購it硬體的前期準備,讓您像使用水 電 天然氣等公...

mysql有哪些伺服器庫 資料庫伺服器有哪些

資料庫 資料庫伺服器一般都裝有資料庫,如oracle,mssql,mysql 等,如 oracle的linux伺服器。資料庫,其實就是儲存資料的應用軟體。資料庫伺服器就是在一台高配置的電腦上安裝了提供資料庫服務的軟體 dbms 則這台電腦就稱為資料庫伺服器,資料庫軟體本身支援網路訪問功能。資料庫伺服...

mysql資料庫上傳到伺服器

mysql生成.sql指令碼 在mysql安裝目錄,bin資料夾中 新建乙個記事本,在內新增如下內容 mysqldunp h127.0.0.1 uroot p123 dbname dbname.sql 儲存檔案並重命名,備份mysql為sql指令碼.bat 注意字尾名 雙擊批處理檔案即可生成sql檔...