mysql コマンド ログイン~データベース作成
ログイン~データベース作成までのまとめ
mysql にrootでログイン
#mysql -u root -p
パスワードを聞かれる
Enter password:
ログイン成功すると下記表示
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 99548 Server version: 5.1.46-community-log MySQL Community Server (GPL) Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>んで最初に使いそうなSQL
データベース作成 mysql> create database [テーブル名];
ユーザ作成 mysql> grant all privileges on [テーブル名].* to [ユーザ]@localhost identified by '[パスワード]';ユーザテーブルのリフレッシュ mysql> flush privileges;データベースを表示 mysql> show databases;
データベースを選択
mysql use [テーブル名];
データベース内のテーブルを表示
mysql> show tables;
関連記事:

コメントはまだありません。