Giter Club home page Giter Club logo

Comments (3)

emirozer avatar emirozer commented on May 30, 2024

Thanks for reporting! I will investigate and provide feedback.

from fake2db.

dklesev avatar dklesev commented on May 30, 2024

First error is that there is no password attribute set in mysql_handler.py. So we have a root password defined and it can't connect. Second point is that there are typos after line 87 in mysql_handler.py. And I would add 'IF NOT EXISTS'. And in line 225 is a wrong insert.

fake2db.py

70a71
>     parser.add_argument("--passwd", help="OPTIONAL : Pass of root user. ")
104c105
<                     fake_mysql_handler.fake2db_mysql_initiator(host, port, int(args.rows), str(args.name))
---
>                     fake_mysql_handler.fake2db_mysql_initiator(str(args.passwd), host, port, int(args.rows),         str(args.name))
106c107
<                     fake_mysql_handler.fake2db_mysql_initiator(host, port, int(args.rows))
---
>                     fake_mysql_handler.fake2db_mysql_initiator(str(args.passwd), host, port, int(args.rows))

mysql_handler.py

26c26
<     def fake2db_mysql_initiator(self, host, port, number_of_rows, name=None):
---
>     def fake2db_mysql_initiator(self, passwd, host, port, number_of_rows, name=None):
29a30,31
> 
>         print "PASS: %s" % passwd
32c34
<             cursor, conn = self.database_caller_creator(host, port, name)
---
>             cursor, conn = self.database_caller_creator(passwd, host, port, name)
34c36
<             cursor, conn = self.database_caller_creator(host, port)
---
>             cursor, conn = self.database_caller_creator(passwd, host, port)
57c59
<     def database_caller_creator(self, host, port, name=None):
---
>     def database_caller_creator(self, passwd, host, port, name=None):
71c73
<             conn = mysql.connector.connect(user='root', host=host, port=port)
---
>             conn = mysql.connector.connect(user='root', password=passwd , host=host, port=port)
88c90
<             "CREATE TABLE `simple_registration` ("
---
>             "CREATE TABLE IF NOT EXISTS `simple_registration` ("
96c98
<             "CREATE TABLE `simple_registration` ("
---
>             "CREATE TABLE IF NOT EXISTS `detailed_registration` ("
108c110
<             "CREATE TABLE `user_agent` ("
---
>             "CREATE TABLE IF NOT EXISTS `user_agent` ("
117c119
<             "CREATE TABLE `user_agent` ("
---
>             "CREATE TABLE IF NOT EXISTS `company` ("
128c130
<             "CREATE TABLE `simple_registration` ("
---
>             "CREATE TABLE IF NOT EXISTS `customer` ("
225c227
<                 customer_payload = ("INSERT INTO detailed_registration "
---
>                 customer_payload = ("INSERT INTO customer "

from fake2db.

xiaohanyu avatar xiaohanyu commented on May 30, 2024

Seems there's no password for postgres handler?

from fake2db.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.