# Install and import Mysql on the development environment

**URL:** https://meta.discourse.org/t/install-and-import-mysql-on-the-development-environment/68485
**Category:** Development
**Created:** [August 21, 2017, 4:26pm UTC](https://meta.discourse.org/t/install-and-import-mysql-on-the-development-environment/68485 "2017-08-21T16:26:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bekircem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bekircem/32/44582_2.png) [@bekircem](https://meta.discourse.org/u/bekircem)
#### Post date: [August 21, 2017, 4:26pm UTC](https://meta.discourse.org/t/install-and-import-mysql-on-the-development-environment/68485/1 "2017-08-21T16:26:33Z")

</div>

Hi there!

I’ve installed development environment on my Ubuntu 16.04 local machine by [following this tutorial](https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-ubuntu-for-development/14727). Everything is fine. Discourse is work perfect on localhost:3000.

I want to import my Mybb forum database to my local Discourse installation. I want to apply the steps there, but when i use `./launcher enter app` it failed. (bash: ./launcher no such file or directory)

> [@Migrating from mybb](https://meta.discourse.org/t/migrating-from-mybb/25563/5):
>
> @elberet, thanks for your help so far. I went for the second option - connecting from the Discourse machine to the MySQL server of the running forum (set to maintenance mode) after enabling port 3306 in the firewall and setting bind-address = 0.0.0.0 in /etc/mysql/my.cnf followed by a sudo service mysql restart. Here’s what I’ve done based on your advice: cd /var/discourse ./launcher enter app apt-get update apt-get install libmysqlclient-dev mc -y gem install mysql2 # mysql2-0.3.18 got instal…

```
cd /var/discourse
./launcher enter app
apt-get update
apt-get install libmysqlclient-dev mc -y
gem install mysql2 # mysql2-0.3.18 got installed
su - discourse
cd /var/www/discourse/script/import_scripts
bundle install
mcedit mybb.rb # make edits to the MySQL connection details
RAILS_ENV=production ruby mybb.rb # no idea what "bundle exec" does

```

What should do I have to do sequentially? What should pay attention? I look forward to your suggestions. Thank you.

@pfaffman

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [August 21, 2017, 5:10pm UTC](https://meta.discourse.org/t/install-and-import-mysql-on-the-development-environment/68485/2 "2017-08-21T17:10:35Z")

</div>

> [@Migrating from mybb](https://meta.discourse.org/t/migrating-from-mybb/25563/1):
>
> So far I’ve installed the Discourse Docker image, launched a local MySQL server and populated it with the data from MyBB.

In your linked tutorial he used Docker environment instead of development environment which you used. `./launcher enter app` is docker command. It is not needed in development environment.

---

<div class="post-metadata">

### Author: ![bekircem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bekircem/32/44582_2.png) [@bekircem](https://meta.discourse.org/u/bekircem)
#### Post date: [August 21, 2017, 5:30pm UTC](https://meta.discourse.org/t/install-and-import-mysql-on-the-development-environment/68485/3 "2017-08-21T17:30:40Z")

</div>

Oh. You have a point there! I forgot this. So Should i continue by skipping this step like this?

```
cd /var/discourse
apt-get update
apt-get install libmysqlclient-dev mc -y
gem install mysql2 # mysql2-0.3.18 got installed
cd /var/www/discourse/script/import_scripts
bundle install
mcedit mybb.rb
RAILS_ENV=production ruby mybb.rb

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 21, 2017, 5:58pm UTC](https://meta.discourse.org/t/install-and-import-mysql-on-the-development-environment/68485/4 "2017-08-21T17:58:53Z")

</div>

You’ll run the importer on your development environment. When it’s done, back up the database from the web interface and upload that file to your production server.

---

<div class="post-metadata">

### Author: ![bekircem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bekircem/32/44582_2.png) [@bekircem](https://meta.discourse.org/u/bekircem)
#### Post date: [August 21, 2017, 8:12pm UTC](https://meta.discourse.org/t/install-and-import-mysql-on-the-development-environment/68485/6 "2017-08-21T20:12:22Z")

</div>

Should i install mysql client, create database, import my backup database and after run import script, right?

`apt-get install libmysqlclient-dev mc -y`

Thank you for answer.
