<p>This table isnt part of the MPOS schema you have to create it yourself, my schema for this table is:</p>

<pre><code>mysql&gt; show columns from shares;
+-----------------+--------------+------+-----+---------+----------------+
| Field           | Type         | Null | Key | Default | Extra          |
+-----------------+--------------+------+-----+---------+----------------+
| shareID         | int(11)      | NO   | PRI | NULL    | auto_increment |
| rem_host        | varchar(100) | YES  |     | NULL    |                |
| username        | varchar(100) | YES  |     | NULL    |                |
| our_result      | varchar(255) | YES  |     | NULL    |                |
| upstream_result | varchar(255) | YES  |     | NULL    |                |
| reason          | varchar(255) | YES  |     | NULL    |                |
| solution        | varchar(255) | YES  |     | NULL    |                |
+-----------------+--------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)
</code></pre>

<p>I keep this in a seperate db to MPOS but there is no reason you cant add it manually to the MPOS table.  I will also add that while this works I'm not certain if varchar is the correct datatype to use here.</p>

CC BY-SA 3.0
2014-03-23T21:50:23.837Z
Where does this table comes from? I found the same issue here https://github.com/Crypto-Expert/stratum-mining/issues/52 but the solution doesn't yield the exact same schema. What does it mean?
gturri
CC BY-SA 3.0
2014-03-23T21:54:12.720Z
Its one I made after looking through the source code.
hafnero
CC BY-SA 3.0
2014-03-23T22:37:35.737Z
Thanks. I guess I'll post as an answer what I found out, since some might be interested in this other solution.
gturri
CC BY-SA 3.0
2014-03-04T10:48:57.100Z
2014-03-04T10:48:57.100Z
hafnero
<p>I stumbled upon the same issue when trying to install <a href="https://github.com/MPOS/php-mpos" rel="nofollow">php-mpos</a>. Fortunately, the <a href="https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide" rel="nofollow">quick start guide</a> provides an answer.</p>

<p>Just run <code>sudo mysql -p mpos &lt; sql/000_base_structure.sql</code> from the root of the php-mpos repo. It means using this file: <a href="https://github.com/MPOS/php-mpos/blob/development/sql/000_base_structure.sql" rel="nofollow">https://github.com/MPOS/php-mpos/blob/development/sql/000_base_structure.sql</a></p>

CC BY-SA 3.0
2014-03-23T22:40:41.167Z
2014-03-23T22:40:41.167Z
gturri
<blockquote>
  <p>I am trying to bring up stratum mining on a pool and get this error -> exceptions.Exception: There is no shares table. Have you imported the schema?   Obviously my database is empty but no package I have download from git has a single .sql file to populate the db.  How do you populate the schema?</p>
</blockquote>

<p><a href="https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide" rel="nofollow">https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide</a>
<a href="https://github.com/ahmedbodi/stratum-mining/issues/97" rel="nofollow">https://github.com/ahmedbodi/stratum-mining/issues/97</a></p>

<pre><code>gentoo001 stratum-mining # locate .sql
/usr/portage/dev-db/mysql-udf-base64/files/mysql-udf-base64.sql
/usr/portage/mail-filter/gld/files/tables.sql
/usr/share/doc/mysql-5.1.70/scripts/mysql_fix_privilege_tables.sql.bz2
/usr/share/doc/mysql-5.1.70/scripts/mysql_system_tables.sql.bz2
/usr/share/doc/mysql-5.1.70/scripts/mysql_system_tables_data.sql.bz2
/usr/share/doc/mysql-5.1.70/scripts/mysql_system_tables_fix.sql.bz2
/usr/share/doc/mysql-5.1.70/scripts/mysql_test_data_timezone.sql.bz2
/usr/share/mysql/fill_help_tables.sql
/usr/share/mysql/mysql_fix_privilege_tables.sql
/usr/share/mysql/mysql_system_tables.sql
/usr/share/mysql/mysql_system_tables_data.sql
/usr/share/mysql/mysql_test_data_timezone.sql
</code></pre>

<bitcoind><mining-pools><stratum>
no schema for stratum
dooode
# no schema for stratum

(Asked by: username_0 on 2014-01-25)

> I am trying to bring up stratum mining on a pool and get this error -> exceptions.Exception: There is no shares table. Have you imported the schema? Obviously my database is empty but no package I have download from git has a single .sql file to populate the db. How do you populate the schema?

<https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide>
<https://github.com/ahmedbodi/stratum-mining/issues/97>

```
gentoo001 stratum-mining # locate .sql
/usr/portage/dev-db/mysql-udf-base64/files/mysql-udf-base64.sql
/usr/portage/mail-filter/gld/files/tables.sql
/usr/share/doc/mysql-5.1.70/scripts/mysql_fix_privilege_tables.sql.bz2
/usr/share/doc/mysql-5.1.70/scripts/mysql_system_tables.sql.bz2
/usr/share/doc/mysql-5.1.70/scripts/mysql_system_tables_data.sql.bz2
/usr/share/doc/mysql-5.1.70/scripts/mysql_system_tables_fix.sql.bz2
/usr/share/doc/mysql-5.1.70/scripts/mysql_test_data_timezone.sql.bz2
/usr/share/mysql/fill_help_tables.sql
/usr/share/mysql/mysql_fix_privilege_tables.sql
/usr/share/mysql/mysql_system_tables.sql
/usr/share/mysql/mysql_system_tables_data.sql
/usr/share/mysql/mysql_test_data_timezone.sql

```

**Tags:** bitcoind, mining-pools, stratum


---

## 2 answers

### Answer by username_1 on 2014-03-04. Score: 1

This table isnt part of the MPOS schema you have to create it yourself, my schema for this table is:

```
mysql> show columns from shares;
+-----------------+--------------+------+-----+---------+----------------+
| Field           | Type         | Null | Key | Default | Extra          |
+-----------------+--------------+------+-----+---------+----------------+
| shareID         | int(11)      | NO   | PRI | NULL    | auto_increment |
| rem_host        | varchar(100) | YES  |     | NULL    |                |
| username        | varchar(100) | YES  |     | NULL    |                |
| our_result      | varchar(255) | YES  |     | NULL    |                |
| upstream_result | varchar(255) | YES  |     | NULL    |                |
| reason          | varchar(255) | YES  |     | NULL    |                |
| solution        | varchar(255) | YES  |     | NULL    |                |
+-----------------+--------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)

```

I keep this in a seperate db to MPOS but there is no reason you cant add it manually to the MPOS table. I will also add that while this works I'm not certain if varchar is the correct datatype to use here.

> **Comments:**
> **username_2**: Where does this table comes from? I found the same issue here https://github.com/Crypto-Expert/stratum-mining/issues/52 but the solution doesn't yield the exact same schema. What does it mean?  
> **username_1**: Its one I made after looking through the source code.  
> **username_2**: Thanks. I guess I'll post as an answer what I found out, since some might be interested in this other solution.  

---

### Answer by username_2 on 2014-03-23. Score: 0

I stumbled upon the same issue when trying to install [php-mpos](https://github.com/MPOS/php-mpos). Fortunately, the [quick start guide](https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide) provides an answer.

Just run `sudo mysql -p mpos < sql/000_base_structure.sql` from the root of the php-mpos repo. It means using this file: <https://github.com/MPOS/php-mpos/blob/development/sql/000_base_structure.sql>


---

