racl101 + mysql   511

Laravel + Docker Part 1 — setup for Development – Shane Osbourne – Medium
This tutorial uses version 2 of the Docker Compose syntax. Also, it seems like a pretty through example. Most examples only show you how to do nginx and php-fpm but not MySQL
medium  blog  tutorial  howto  setup  laravel  docker  php  php-fpm  nginx  mysql  docker-compose  compose  example  guide  reference  toread  tolearn  totry  tounderstand  virtual  host 
november 2018 by racl101
Backup (mysql dump) all your MySQL databases in separate files - Running with Ruby
Really good, simple to understand Bash shell script demonstrating how to backup all the databases in a given mysql server installation into a single file or into separate files (one for each database).
blog  tutorial  howto  example  guide  reference  backup  export  database  dump  sql  files  shell  script  single  separate  mysql  bash 
november 2018 by racl101
Installing MySQL (with Debconf) | Servers for Hackers

echo mysql-server mysql-server/root_password password root | debconf-set-selections;\
echo mysql-server mysql-server/root_password_again password root | debconf-set-selections;\
apt-get install -y mysql-server mysql-client libmysqlclient-dev

So that you don't have install mysql server interactively and can set the root password programmatically.

Works for installing MySQL 5.7 on Ubuntu 16.04 as well.
blog  tutorial  screencast  video  howto  install  mysql  mysql5.7  server  debian  configuration  root  password  programmatically  ubuntu  ubuntu16.04  script  bash  shell  example  guide  reference 
october 2018 by racl101
Script to open a mysql database in Sequel Pro from a service in docker-compose.
A gist of an Bash Shell Script to open up Sequel Pro MacOS / MacOS X app with credentials to view a MySQL database running within a Docker container.
github  gist  script  bash  shell  open  sequel  pro  sequelpro  database  mysql  docker  container  credentials  totry  guide  reference 
october 2018 by racl101
Connecting to a mysql running on a Docker container · Issue #95 · docker-library/mysql
Frankly, this forum page has no consensus on a solution to this issue. Nevertheless, what worked for me on my set up with running MacOS as the Docker host and running a container with: Ubuntu 16.04 and MySQL 5.7 is the following:

1) Within the container: change in /etc/mysql/mysql.conf.d/mysqld.cnf the bind-address option from to
2) Restart MySQL server (note that whenever you start MySQL you must use this command in the Dockerfile:

RUN sed -i -e"s/^bind-address\s*=\s* =" /etc/mysql/mysql.conf.d/mysqld.cnf
RUN find /var/lib/mysql -type f -exec touch {} \; && service mysql start

That is, you must touch the files in /var/lib/mysql and then start the server with service command and not systemctl.

Next, create a user separate from root e.g. dev_1, in MySQL and given them privileges to their '' and '%' hosts. Like this in the Dockerfile:

RUN find /var/lib/mysql -type f -exec touch {} \; && service mysql start && mysql -uroot -proot mysql -e "GRANT ALL ON *.* TO root@'' IDENTIFIED BY 'secret' WITH GRANT OPTION; CREATE USER 'dev_1'@'' IDENTIFIED BY 'secret'; GRANT ALL ON *.* TO 'dev_1'@'' IDENTIFIED BY 'secret' WITH GRANT OPTION; GRANT ALL ON *.* TO 'dev_1'@'%' IDENTIFIED BY 'secret' WITH GRANT OPTION; FLUSH PRIVILEGES;"

Then when you start the container you must publish the port number like so:

docker run -t -d -p 4406:3306 ubuntu_16_04_lemp_php_7_2:latest

If your container stops prematurely, then you might want to add a CMD line in your docker file to run a start.sh script and within that script you might want to add something like this:

# stupid hack to keep container from being stopped
tail -f /dev/null

Finally, to connect to your DB instance on your local MacOS machine with an app like Sequel Pro for example, use the following credentials:

Username: dev_1
Password: <dev_1_password>
Port: 4406

If you don't like to use port 4406, try 3307, 3308, 3309.
github  forum  howto  example  troubleshoot  mysql  server  docker  host  connection  issue  sequel  pro  mariadb  client  hostname  docker-machine  ip  address  ipaddress  guide  reference  toread  tolearn  totry  tounderstand  image  port  detached  database  credentials 
october 2018 by racl101
SQLAlchemy Documentation — SQLAlchemy 1.2 Documentation
Seems that the key to learning to work with databases in Python requires understanding SQL Alchemy.
documentation  guide  reference  sqlalchemy  python  database  toolkit  driver  orm  relational  engine  mysql  sqlite3  tutorial  howto  example  resource 
september 2018 by racl101
MySQL :: MySQL 5.7 Reference Manual :: 4.2.6 Using Option Files
Check out the table under the heading: "Option Files Read on Unix and Unix-Like Systems" to see where (and in what order) MySQL checks for options.

Of specific importance for logging in passwordless, at least with Ansible, is the ~/.my.cnf file.
mysql  server  config  documentation  guide  reference  my.cnf  user  howto  example  toread  tolearn  totry  tounderstand 
july 2018 by racl101
Ansible Install MySql 5.7 - Set Root User Password - Stack Overflow
This response explains a nuance for MySQL 5.7 whereby you can't log in as a root user with no password.

To change the password for a root user for the first time you have to do something like this:

- name: Check if '~/.my.cnf' exists
path: ~/.my.cnf
register: my_cnf_check

- name: Update MySQL root password for all root accounts
name: root
host: "{{ item }}"
password: "{{ mysql_root_password }}"
state: present
check_implicit_admin: "{{ 'no' if my_cnf_check.stat.exists == True else 'yes' }}"
- ::1
- localhost
become: "{{ 'no' if my_cnf_check.stat.exists == True else 'yes' }}"
become_method: sudo

- name: Create MySQL '~/.my.cnf' config file and add root credentials into it
template: src=templates/mysql_my.cnf.j2 dest=~/.my.cnf mode=0600
stackoverflow  ansible  mysql  mysql5.7  howto  example  guide  reference  update  root  user  password  my.cnf  sudo  admin 
july 2018 by racl101
Error during install , "python mysqldb module is required" · Issue #42 · geerlingguy/ansible-role-mysql
If using python3 as the Ansible Python Interpreter then you'll need to install both:

- python3-pip
- python3-mysqldb

to be able to update mysql user passwords with Ansible.
github  forum  mysql  module  howto  fix  troubleshoot  python  python3  ansible  update  root  password  user  example  guide  reference  pip 
july 2018 by racl101
Update Amazon RDS max_connections with Parameter Group · Issue #16 · jollygoodcode/jollygoodcode.github.io
This thread discussion might provide some insight into manually increasing the mysql max_connections option / setting manually and overriding Amazon's AWS "sensible" defaults.
github  forum  aws  amazon  howto  override  change  mysql  database  db  option  variable  max_connections  setting  totry  example  guide  reference 
april 2018 by racl101
MySQL 5.7.12 import cannot create a JSON value from a string with CHARACTER SET 'binary' - Stack Overflow
For single , double quoting issue reasons you might elect to encode your database dump containing a column containing a column that holds JSON data (MySQL sees this as blob data). Then you might need to import this dump again. In those cases you can decode the hexadecimal strings using the MySQL CONVERT function into the original string with utf8mb4 encoding.This is how you do it.
stackoverflow  mysql  mysql5.7  mysqldump  dump  blob  data  utf8mb4  column  convert  decode  hexadecimal  howto  example  guide  reference 
april 2018 by racl101
MySQLdb User's Guide
I don't get it, but I guess you're supposed to use %s as a placeholder even for integers (so not %d) in a query string that is used in a cursor.execute() statement. I tried it with pymysql. I'm not sure why, but it worked.

This is the explanation: In this example, max_price=5 Why, then, use %s in the string? Because MySQLdb will convert it to a SQL literal value, which is the string '5'. When it's finished, the query will actually say, "...WHERE price < 5".
mysql-python  howto  troubleshoot  cursor  mysql  pymysql  query  python  python2.7  string  format  number  error  fix  guide  reference  examples 
april 2018 by racl101
mysql - MySQLdb Python insert %d and %s - Stack Overflow
I don't get it, but I guess you're supposed to use %s as a placeholder even for integers (so not %d) in a query string that is used in a cursor.execute() statement. I tried it with pymysql. I'm not sure why, but it worked.
stackoverflow  howto  troubleshoot  cursor  mysql  pymysql  query  python  python2.7  string  format  number  error  fix  guide  reference 
april 2018 by racl101
insertion - Python MySQLdb issues (TypeError: %d format: a number is required, not str) - Stack Overflow
I don't get it, but I guess you're supposed to use %s as a placeholder even for integers (so not %d) in a query string that is used in a cursor.execute() statement. I tried it with pymysql. I'm not sure why, but it worked.
stackoverflow  howto  troubleshoot  cursor  mysql  pymysql  query  python  python2.7  string  format  number  error  fix  guide  reference 
april 2018 by racl101
Welcome to PyMySQL’s documentation! — PyMySQL 0.7.2 documentation
The documentation is kind of sparse, but it has some good reference links. That's where the meat is.
python  library  pymysql  module  database  mysql  query  api  guide  reference  documentation 
march 2018 by racl101
« earlier      
per page:    204080120160

related tags

9.10  access  account  accounts  acl  active-record  adapter  add  address  admin  administration  administrator  advanced  advice  aggregate  aggregated  ajax  algorithms  aliasing  all  allocation  alphabetic  alphanumeric  alter  amazon  amazonlinux  amazonlinux2  ami  Angularjs  anonymous  another  ansible  apache  apache2  apache_mysql_php  api  app  apple  application  applications  apply  apt  apt-get  archive  articles  askubuntu  assign  asterik  Authentication  auto_increment  auto_increment_increment  average  away  awesome  aws  back  backend  backup  bash  batch  beginner  behavior  benchmark  best  bestpractice  bestpractices  between  bigint  binary  bind  bitnami  blob  blog  boolean  boolean-mode  boolean-search  boxfile  brew  build  builder  by  byte  bytes  cache  caching  calculate  cannot  cascade  cast  casting  catch  centos  certificate  change  character  character-set  characters  charactersets  chars  charset  cheatsheet  check  checks  class  clause  cli  client  cloud  cloudsites  cms  code  Codeguard  codeigniter  codex  collation  collations  column  columns  comma  command  commandline  commands  comments  compare  comparison  compile  compose  Composer  compromised  computer  CONCAT  concatenation  condition  conditional  conf  config  configuration  configure  connect  connection  connections  constraint  container  content  convert  converter  converting  convert_tz  coolestguideontheplanet  coolestguidesontheplanet  coolestguyontheplanet  copy  count  counter  create  created  credentials  cron  cronjob  cross  cryptography  cspan  css  csv  currency  current  current_time  cursor  custom  cyberciti  data  database  databases  Datadir  dataframe  Dataonly  datatypes  date  datetime  DATE_add  DATE_FORMAT  david-walsh  db  dba  dba.stackexchange  dbadmin  dbd  dbdeploy  dbdump  dbi  deb  debconf  debian  decimal  decode  decrease  default  delete  demo  deploy  deployment  design  detached  dev  development  diagram  Diff  difference  differences  different  digitalocean  digitialocean  directory  disable  distinct  distro  django  docker  docker-compose  docker-machine  dockerfile  dockerize  doctrine  documentation  donation  double  download  dreamhost  driver  drop  dump  duplicate  duplicates  dylib  dynamic  dynamiclibrary  dzone  each  ebook  ec2  ecommerce  edit  editor  ee2  eer  eloquent  emulation  encoding  encryption  engagement  engine  engineer  entity  entries  entry  enum  environment  error  escape  escaping  ess  Eval  exact  example  examples  exception  execute  EXISTS  explanation  exponent  export  expressionengine  external  ezsql  failure  Fiddle  field  fields  file  filemaker  filemakerpro  files  find  fix  float  floatingpoint  flush  for  foreign  foreignkey  format  forum  forums  forwarding  frame  framework  free  from  FTP  fuelphp  fulltext  function  functions  gd  gem  generator  get  getaddresses  gettingstarted  gist  Git  github  give  gone  gotcha  gotchas  grant  grants  gravityforms  greater  grep  grouby  group  groupby  grouped  Grouping  GROUP_CONCAT  gui  guide  hack  hacked  handle  handles  hard  hash  having  help.ubuntu  heroku  hexadecimal  hierarchical  Homebrew  homestead  horizontal  host  hostname  hosts  howto  howtoforge  htaccess  http  id  identifier  image  imporant  import  in  including  incorrect  increase  index  indexes  indexing  INex  information  inner  innodb  inspect  install  installation  instance  instances  int  integer  interesting  interface  interview  into  invoice  ip  ipaddress  is  issue  Java  join  JOINS  json  json_contains  justin  justinvincent  kb  key  keys  knowledgebase  lamp  laracasts  laravel  laravel4  laravel5  laravel5.4  large  learning  left  lemp  length  leopard  less  level_access  library  lightsail  like  limit  limits  line  linux  lion  list  Load  local  location  lock  log  Logic  logical  login  login_system  long  lookup  lower  lowercase  mac  machine  macos  macosx  macosx10.6  macosx10.9  macosx10.10  macport  macports  mamp  management  manager  manpage  manual  manually  many  mariadb  matching  math  mavericks  max  maximum  max_connection  max_connections  md5  Measure  mediatemple  medium  mediumint  memory  migrate  migration  migrations  min  minimum  mistakes  mode  modeling  module  mod_wsgi  money  mountain  mountainlion  move  mssql  multi  multibyte  multiple  multitenancy  multitenant  my.cnf  Myisam  mysql  mysql-python  mysql.sock  mysql2  mysql5  mysql5.6.x  mysql5.7  mysqladmin  mysqldb  mysqldump  mysqli  mysqli_connect  Mysqli_ssl_set  Mysqlslap  mysql_backup  mysql_config_editor  mysql_db_query  mysql_functions  mysql_secure_installation  name  named  names  navidat  nettuts  network  new  newest  nextgen  nginx  nixcraft  no  node  nodejs  non-aggregated  not  notation  null  number  numbers  numeric  obfuscate  object  occurrences  odbc  offset  oldest  ondelete  one  onLy  onupdate  oop  open  opensource  open_files_limit  operator  operators  optimization  option  options  Oracle  order  orderby  orm  os  osx  outside  override  overrun  package  packagist  pagination  paging  pagodabox  pandas  passenger  password  passwordless  pattern  paypal  pdo  pear  peewee  percentage  performance  perl  permissions  phing  php  php-fpm  php.ini  php5  php7  phpbuilder  phpmyadmin  phpunit  PHP_Login_System  pip  playbook  plugin  plugins  pma  populate  port  postgre  postgres  postgresql  practices  precision  prefix  primary  privileges  pro  procedure  procedures  process  processes  processlist  program  programmatically  programming  project  pymysql  python  python2.7  python3  queries  query  quickstart  rackspace  rackspacecloud  rails  Rails4  rake  rand  random  range  ranges  rds  read  rebuilding  record  records  redirect  reference  regex  regexp  relational  remote  Remotely  remove  rename  repairing  replace  repo  repository  requested  requirements  resolution  resolve  resource  restart  restore  RESTrict  results  reverse  revoke  Rlike  root  ror  round  rounding  row  rows  ruby  rubyonrails  same  schema  science  scientific  screencast  script  scripts  search  searchengine  searching  secure  security  select  Selectable  separate  separated  sequel  sequelpro  serialized  server  server-2008  serverfault  servers  service  services  set  sets  setting  settings  setup  setup_postdata  shell  shortest  show  shuffle  sierra  signed  Simplon  single  size  sizes  slow  snippets  snipplet  snow-lopard  snowleopard  soft  software  sorting  sources  sql  sqlalchemy  sqlbuddy  SQLfiddle  sqlite3  Ssh  Ssl  stack  stackexchange  stackoverflow  start  statement  Stop  storage  store  Stored  Storedprocedure  string  strings  sub  subquery  SUBSTRINg  SUBSTRING  sudo  sum  support  suspicious  syntax  sysadmin  sysbench  system  table  tables  temporary  terminal  test  testing  text  than  theme  Thread  time  timeout  timestamp  timezone  Timing  tip  tips  to  Tocheck  tocheckout  tolearn  too  tool  toolkit  tools  toread  totry  touch  tounderstand  transaction  transactions  tree  tricks  trigger  troubleshoot  troubleshooting  troubleshot  truncate  truncated  try  tuner  tuning  tutorial  tutorials  twitter  type  types  ubuntu  ubuntu12.04  ubuntu14.04  ubuntu16.04  ulimit  under  understand  unicode  unique  unit  unix  unixcraft  unix_timestamp  unsigned  update  upgrade  url  usage  use  useful  user  users  utf8  utf8mb4  utilities  utility  vagrant  value  values  vanilla  varchar  variable  variables  vendor  vertical  video  view  views  vincent  virtual  vps  w3c  w3chools  w3schools  wait  wamp  web  webapp  webdesign  webdev  when  where  whEREin  Wiki  windows  windows-server  windows-server-2008  with  wordpress  work  workaround  workbench  wpdb  wpengine  wptuts  write  x  xcode  xdebug  yosemite  zone 

Copy this bookmark: