LoginSignup
0

More than 3 years have passed since last update.

MySQL でサンプルデータなどをMySQlにインポートする (超初心者)

Posted at

なぜ書こうと思ったのか?

MySQLを使ってSQLを練習をしたと思ってサンプルデータをMySQLに取り込もうとしたら
インポートできなかったので自分しかこんな問題起こさないと思いますが
自分用に記事を残しています

とりあえずデータをインポートしてみよう

windows10

cd /(cドライブに飛びます)
c:\> cd xampp 
c:\xampp> cd mysql
c:\xampp\mysql> cd bin
c:\xampp\mysql\bin> 
c:\xampp\mysql\bin>mysql -u root 
DBに入る

/ ←(windowsのエンマークです)

MariaDB [(none)]>use main
MariaDB [(main)]> source import data

これでインポートできます
source コマンドの後にインポートしたいデータのパスを指定します
まぁパスがわからなかったら.sqlファイルを直接その場所に落としても大丈夫だと思います
ちなみに自分が出たエラーは#1046でしたww
入れる箱も選んでないのに無理やり入れようとしてたみたいです( *´艸`)

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