0
0

More than 3 years have passed since last update.

MYSQL備忘録

Last updated at Posted at 2020-12-12

プログラミング初心者です。個人的なメモとして活用しています。

1環境構築をしたものの、アプリが立ち上がってもログインできない!

IDとPWが配られていない!
今までそう思っていましたがDBにIDとPWを突っ込んだらログインできたので記録として残します。

DBの接続が完了し、ID/PWが格納されているテーブルが特定されている状態とする。
UPDATE 'ID/PWが格納されたテーブル名' set 'passwordが格納されてる箇所' = md5('使用したいパスワード') where id = 'ID名';

これでログインできる。

2DB関連のクエリの書き方

1.テーブルの作成
create table db名.table名 (id int,name varchar(254));

2.テーブルのデータ挿入
insert into table名(id,name)
values (3,"Kate");

3.テーブルのデータ型の確認
show columns from table名

4.テーブルの中身の確認
select * from table名

5.テーブルへのAuto_incrementの追加
alter table table名 add primary key (id);
alter table table名 change id id int(11) auto_increment;

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0