Python Forum
pymysql: insert query throws error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pymysql: insert query throws error
#8
Are you not overly complicating a simple matter?

Admittedly, I am the only user on my laptop and I don't know much about this, but you are dealing with a simple text file.

My /etc/sudoers file looks like this in nano:

Quote:#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/>

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

What do you want to get from this?

You could theoretically have 1 column for DEFAULTS and 5 columns for user, host, user_alias, group_alias, command in your db

Quote:root ALL=(ALL:ALL) ALL
The first field indicates the username that the rule will apply to (root).

root ALL=(ALL:ALL) ALL
The first “ALL” indicates that this rule applies to all hosts.

root ALL=(ALL:ALL) ALL
This “ALL” indicates that the root user can run commands as all users.

root ALL=(ALL:ALL) ALL
This “ALL” indicates that the root user can run commands as all groups.

root ALL=(ALL:ALL) ALL
The last “ALL” indicates these rules apply to all commands.

Can't you just parse the text file to a dictionary and put in your db?
Reply


Messages In This Thread
pymysql: insert query throws error - by wardancer84 - Jan-21-2022, 12:54 PM
RE: pymysql: insert query throws error - by Pedroski55 - Jan-24-2022, 11:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  sqlite3 Conn Insert Value Error TylerDunbar 3 784 Sep-04-2023, 06:32 PM
Last Post: deanhystad
  pymysql; insert on duplicate key update fails wardancer84 4 2,071 Jun-28-2022, 08:14 PM
Last Post: Larz60+
  Mysql Syntax error in pymysql ilknurg 4 2,414 May-18-2022, 06:50 AM
Last Post: ibreeden
  Mysql error message: Lost connection to MySQL server during query tomtom 6 16,294 Feb-09-2022, 09:55 AM
Last Post: ibreeden
  Query Syntax Error hammer 2 1,650 Jan-03-2022, 02:30 PM
Last Post: hammer
  pymysql can't do SELECT * Pedroski55 3 3,024 Sep-11-2021, 10:18 PM
Last Post: Pedroski55
  TypeError: sequence item 0: expected str instance, float found Error Query eddywinch82 1 5,183 Sep-04-2021, 09:16 PM
Last Post: eddywinch82
  Error using mariadb select query with form in python? shams 2 2,054 Jul-29-2021, 12:30 PM
Last Post: shams
  pyarrow throws oserror winerror 193 1 is not a valid win32 application aupres 2 3,836 Oct-21-2020, 01:04 AM
Last Post: aupres
  Function throws error but then works? Milfredo 10 3,847 Sep-12-2020, 05:16 AM
Last Post: Milfredo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020