0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

webarenaでubuntu その21

Last updated at Posted at 2019-08-20

概要

webarenaでubuntu18.04やってみた。
mysql5.7やってみた。

コマンドラインに入る。

sudo mysql -u root -p

データーベースを作成。

create database mydb character set utf8;

ユーザーを作る。

create user 'arena'@'localhost' identified by 'pass';

権限をつける。

grant all privileges on mydb.* to 'arena'@'localhost';

phpでテーブル作る。

<?php
    $db = new PDO("mysql:host=localhost;dbname=mydb;", 'arena', 'pass');
    $sql = 'create table test(id INT(10) AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20), age INT(4), r_time DATETIME)';
    $res = $db->query($sql);
    print "ok\n";
?>

結果を見る。

use mydb;
show columns from test;

以上。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?