mysql 入力
の編集
http://sek-net.no-ip.info/wikiZ+/index.php?mysql%20%E5%85%A5%E5%8A%9B
[
トップ
] [
編集
|
差分
|
バックアップ
|
添付
|
リロード
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
-- 雛形とするページ --
AlmaLinux
BracketName
ComicList 検索の DB化
DB 複製
F660A
FTPサーバー
FormattingRules
FrontPage
Get Started with Best Local Dating Website For Quick Sex
Get Started with Online Casual Dating Apps No Cost
Guide To Best Casual Encounters Website Usa
Help
InterWiki
InterWikiName
InterWikiSandBox
L2TP/IPSec
Lara 7→8
Lara Apacheで見れるように
Laravel
Laraインストール
Laraインストール2
Laraサンプルを作る
Laraララ帳要点メモ
MenuBar
MySQL
N54l BIOS UPDATE
NIS
PHP
PukiWiki
PukiWiki/1.4
PukiWiki/1.4/Manual
PukiWiki/1.4/Manual/Plugin
PukiWiki/1.4/Manual/Plugin/A-D
PukiWiki/1.4/Manual/Plugin/E-G
PukiWiki/1.4/Manual/Plugin/H-K
PukiWiki/1.4/Manual/Plugin/L-N
PukiWiki/1.4/Manual/Plugin/O-R
PukiWiki/1.4/Manual/Plugin/S-U
PukiWiki/1.4/Manual/Plugin/V-Z
RP4 Centos stream 9
Raspberry Pi 4
Raspberry Pi Zero(W)
RecentDeleted
SEK
SandBox
SoftEther
Strongswan
Tips
UUID
VirtualBox
WEBカメラ
WEBサーバー
WEBページの設置
WikiEngines
WikiName
WikiWikiWeb
YukiWiki
centos7
centos8
centos9 stream
comic
cron
css
date
dd
defgbrtgert
domain
down.sh
firewalld
format
fstab
fstab の話
gid uid
guide
haproxy
history
html
httpd
httpd.service
httpサーバー
ilfa
install から設定まで
ldap
linux(other)
lyon
mami
mami Dnsmasq
mami FTP Server
mami File Server
mami Mail Server
mami MariaDB 10.2
mami NextCloud
mami PHP 7
mami WEB Server
mami phpMyAdmin
mami subversion
mami update計画
mami 基本設定
mami3インストール
mamiインストール
mami旧インストール
multi
mydns
mysql
mysql 入力
network
nmcli
noip
noip_dcu
php
php file (RPZW)
phpMyAdmin
pound
repo
rpm作成
rsync
samba
serio
ssh
standby
virtual host
wikiZ+ の移行
write-protected
yum upgrade
その他
アセンブラ
カメラを動かす (RPZW)
キャッシュの回避
サーバーTips
データベース
ネガの補正
ピアノ教室
ファイルサーバー
マシン
メモ帳
作業状況
傾向
共通関数
内容
写真をRAMに保存 (RPZW)
初めに (RPZW)
初めに (Raspberry Pi Zero W)
初期設定 (RPZW)
基本情報技術者試験
基本設定
定点カメラ
新生lyon
新生mami
毎日の処理
画像を保存 (RPZW)
画像を転送 (RPZW)
画像変換
発表会ポスター
知恵袋
計画 (RPZW)
課題 (RPZW)
[[mysql]] [[マニュアル:https://dev.mysql.com/doc/refman/5.6/ja/]] [[【MySQL, SQL】データベースを扱う基本SQL一覧:https://qiita.com/knife0125/items/bb095a85d1a5d3c8f706]] [root@pc0700-vm wp]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 39 Server version: 8.0.17 Source distribution Copyright (c) 2000, 2019, 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> mysql> select Host, User from mysql.user; +-----------+------------------+ | Host | User | +-----------+------------------+ | localhost | admin | | localhost | mysql.infoschema | | localhost | mysql.session | | localhost | mysql.sys | | localhost | phpmyadmin | | localhost | redmine | | localhost | root | | localhost | wordpress | +-----------+------------------+ 8 rows in set (0.00 sec) mysql> mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | phpmyadmin | | redmine | | sys | | wordpress | +--------------------+ 7 rows in set (0.00 sec) mysql> mysql> create database test; Query OK, 1 row affected (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | phpmyadmin | | redmine | | sys | | test | | wordpress | +--------------------+ 8 rows in set (0.00 sec) mysql> use test; Database changed mysql> show tables; Empty set (0.01 sec) mysql> mysql> create table test ( -> id int(10) unsigned NOT NULL AUTO_INCREMENT, -> name varchar(64) NOT NULL, -> address varchar(128) NOT NULL, -> tel varchar(64) NOT NULL, -> PRIMARY KEY (id) -> ); Query OK, 0 rows affected, 1 warning (0.03 sec) mysql> show tables; +----------------+ | Tables_in_test | +----------------+ | test | +----------------+ 1 row in set (0.00 sec) mysql> show create table test; .. | test | CREATE TABLE `test` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(64) NOT NULL, `address` varchar(128) NOT NULL, `tel` varchar(64) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci | .. 1 row in set (0.00 sec) mysql> insert into test ( id, name, address, tel) values(1, 'sekigawa', 'kanagawa', '0123'); Query OK, 1 row affected (0.01 sec) mysql> select * from test; +----+----------+----------+------+ | id | name | address | tel | +----+----------+----------+------+ | 1 | sekigawa | kanagawa | 0123 | +----+----------+----------+------+ 1 row in set (0.00 sec) mysql> mysql> use wordpress; 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> mysql> select database(); +------------+ | database() | +------------+ | wordpress | +------------+ 1 row in set (0.00 sec) mysql> mysql> show tables; +-----------------------+ | Tables_in_wordpress | +-----------------------+ | wp_commentmeta | | wp_comments | | wp_links | | wp_options | | wp_postmeta | | wp_posts | | wp_term_relationships | | wp_term_taxonomy | | wp_termmeta | | wp_terms | | wp_usermeta | | wp_users | +-----------------------+ 12 rows in set (0.00 sec) mysql> mysql> show create table wp_options\G *************************** 1. row *************************** Table: wp_options Create Table: CREATE TABLE `wp_options` ( `option_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `option_name` varchar(191) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '', `option_value` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL, `autoload` varchar(20) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'yes', PRIMARY KEY (`option_id`), UNIQUE KEY `option_name` (`option_name`), KEY `autoload` (`autoload`) ) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci 1 row in set (0.00 sec) mysql> mysql> select * from wp_options limit 5; +-----------+--------------------+-----------------------------+----------+ | option_id | option_name | option_value | autoload | +-----------+--------------------+-----------------------------+----------+ | 1 | siteurl | http://192.168.0.38/wp | yes | | 2 | home | http://192.168.0.38/wp | yes | | 3 | blogname | mpiano | yes | | 4 | blogdescription | Just another WordPress site | yes | | 5 | users_can_register | 0 | yes | +-----------+--------------------+-----------------------------+----------+ 5 rows in set (0.00 sec) mysql> mysql> select option_value from wp_options limit 5; +-----------------------------+ | option_value | +-----------------------------+ | http://192.168.0.38/wp | | http://192.168.0.38/wp | | mpiano | | Just another WordPress site | | 0 | +-----------------------------+ 5 rows in set (0.00 sec) mysql> mysql> select option_value from wp_options\G *************************** 1. row *************************** option_value: http://192.168.0.38/wp *************************** 2. row *************************** option_value: http://192.168.0.38/wp *************************** 3. row *************************** option_value: mpiano *************************** 4. row *************************** option_value: Just another WordPress site *************************** 5. row *************************** option_value: 0 mysql> mysql> SELECT 10 * 8 + 4 FROM DUAL; +------------+ | 10 * 8 + 4 | +------------+ | 84 | +------------+ 1 row in set (0.00 sec) mysql> mysql> update wp_options set option_value='http://192.168.0.41/wp' where option_id='1'; Query OK, 1 row affected (0.02 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select option_value from wp_options limit 5; +-----------------------------+ | option_value | +-----------------------------+ | http://192.168.0.41/wp | | http://192.168.0.38/wp | | mpiano | | Just another WordPress site | | 0 | +-----------------------------+ 5 rows in set (0.00 sec) mysql> mysql> GRANT ALL ON *.* TO admin@localhost; Query OK, 0 rows affected (0.02 sec) mysql> mysql> SHOW COLUMNS FROM articles; +------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+---------------------+------+-----+---------+----------------+ | id | bigint(20) unsigned | NO | PRI | NULL | auto_increment | | title | varchar(255) | NO | | NULL | | | body | text | NO | | NULL | | | created_at | timestamp | YES | | NULL | | | updated_at | timestamp | YES | | NULL | | +------------+---------------------+------+-----+---------+----------------+ 5 rows in set (0.00 sec) mysql>
タイムスタンプを変更しない
[[mysql]] [[マニュアル:https://dev.mysql.com/doc/refman/5.6/ja/]] [[【MySQL, SQL】データベースを扱う基本SQL一覧:https://qiita.com/knife0125/items/bb095a85d1a5d3c8f706]] [root@pc0700-vm wp]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 39 Server version: 8.0.17 Source distribution Copyright (c) 2000, 2019, 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> mysql> select Host, User from mysql.user; +-----------+------------------+ | Host | User | +-----------+------------------+ | localhost | admin | | localhost | mysql.infoschema | | localhost | mysql.session | | localhost | mysql.sys | | localhost | phpmyadmin | | localhost | redmine | | localhost | root | | localhost | wordpress | +-----------+------------------+ 8 rows in set (0.00 sec) mysql> mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | phpmyadmin | | redmine | | sys | | wordpress | +--------------------+ 7 rows in set (0.00 sec) mysql> mysql> create database test; Query OK, 1 row affected (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | phpmyadmin | | redmine | | sys | | test | | wordpress | +--------------------+ 8 rows in set (0.00 sec) mysql> use test; Database changed mysql> show tables; Empty set (0.01 sec) mysql> mysql> create table test ( -> id int(10) unsigned NOT NULL AUTO_INCREMENT, -> name varchar(64) NOT NULL, -> address varchar(128) NOT NULL, -> tel varchar(64) NOT NULL, -> PRIMARY KEY (id) -> ); Query OK, 0 rows affected, 1 warning (0.03 sec) mysql> show tables; +----------------+ | Tables_in_test | +----------------+ | test | +----------------+ 1 row in set (0.00 sec) mysql> show create table test; .. | test | CREATE TABLE `test` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(64) NOT NULL, `address` varchar(128) NOT NULL, `tel` varchar(64) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci | .. 1 row in set (0.00 sec) mysql> insert into test ( id, name, address, tel) values(1, 'sekigawa', 'kanagawa', '0123'); Query OK, 1 row affected (0.01 sec) mysql> select * from test; +----+----------+----------+------+ | id | name | address | tel | +----+----------+----------+------+ | 1 | sekigawa | kanagawa | 0123 | +----+----------+----------+------+ 1 row in set (0.00 sec) mysql> mysql> use wordpress; 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> mysql> select database(); +------------+ | database() | +------------+ | wordpress | +------------+ 1 row in set (0.00 sec) mysql> mysql> show tables; +-----------------------+ | Tables_in_wordpress | +-----------------------+ | wp_commentmeta | | wp_comments | | wp_links | | wp_options | | wp_postmeta | | wp_posts | | wp_term_relationships | | wp_term_taxonomy | | wp_termmeta | | wp_terms | | wp_usermeta | | wp_users | +-----------------------+ 12 rows in set (0.00 sec) mysql> mysql> show create table wp_options\G *************************** 1. row *************************** Table: wp_options Create Table: CREATE TABLE `wp_options` ( `option_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `option_name` varchar(191) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '', `option_value` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL, `autoload` varchar(20) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'yes', PRIMARY KEY (`option_id`), UNIQUE KEY `option_name` (`option_name`), KEY `autoload` (`autoload`) ) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci 1 row in set (0.00 sec) mysql> mysql> select * from wp_options limit 5; +-----------+--------------------+-----------------------------+----------+ | option_id | option_name | option_value | autoload | +-----------+--------------------+-----------------------------+----------+ | 1 | siteurl | http://192.168.0.38/wp | yes | | 2 | home | http://192.168.0.38/wp | yes | | 3 | blogname | mpiano | yes | | 4 | blogdescription | Just another WordPress site | yes | | 5 | users_can_register | 0 | yes | +-----------+--------------------+-----------------------------+----------+ 5 rows in set (0.00 sec) mysql> mysql> select option_value from wp_options limit 5; +-----------------------------+ | option_value | +-----------------------------+ | http://192.168.0.38/wp | | http://192.168.0.38/wp | | mpiano | | Just another WordPress site | | 0 | +-----------------------------+ 5 rows in set (0.00 sec) mysql> mysql> select option_value from wp_options\G *************************** 1. row *************************** option_value: http://192.168.0.38/wp *************************** 2. row *************************** option_value: http://192.168.0.38/wp *************************** 3. row *************************** option_value: mpiano *************************** 4. row *************************** option_value: Just another WordPress site *************************** 5. row *************************** option_value: 0 mysql> mysql> SELECT 10 * 8 + 4 FROM DUAL; +------------+ | 10 * 8 + 4 | +------------+ | 84 | +------------+ 1 row in set (0.00 sec) mysql> mysql> update wp_options set option_value='http://192.168.0.41/wp' where option_id='1'; Query OK, 1 row affected (0.02 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select option_value from wp_options limit 5; +-----------------------------+ | option_value | +-----------------------------+ | http://192.168.0.41/wp | | http://192.168.0.38/wp | | mpiano | | Just another WordPress site | | 0 | +-----------------------------+ 5 rows in set (0.00 sec) mysql> mysql> GRANT ALL ON *.* TO admin@localhost; Query OK, 0 rows affected (0.02 sec) mysql> mysql> SHOW COLUMNS FROM articles; +------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+---------------------+------+-----+---------+----------------+ | id | bigint(20) unsigned | NO | PRI | NULL | auto_increment | | title | varchar(255) | NO | | NULL | | | body | text | NO | | NULL | | | created_at | timestamp | YES | | NULL | | | updated_at | timestamp | YES | | NULL | | +------------+---------------------+------+-----+---------+----------------+ 5 rows in set (0.00 sec) mysql>
テキスト整形のルールを表示する