SlideShare una empresa de Scribd logo
1 de 26
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1
Dave Stokes
MySQL Community Manager
David.Stokes@oracle.com @Stoker
MySQL User Administration
Tips & Tricks
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.2
The following is intended to outline our general product direction. It is
intended for information purposes only, and may not be incorporated
into any contract. It is not a commitment to deliver any material, code,
or functionality, and should not be relied upon in making purchasing
decision. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole
discretion of Oracle.
Safe Harbor Statement
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4
MySQL Manual 6.3.1. User Names
and Passwords
MySQL stores accounts in the user
 table of the mysql database. An
account is defined in terms of a user name
and the client host or hosts from which the
user can connect to the server. The account
may also have a password.
Thus speaketh the
manual
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5
MySQL login ≠ User Login
• Many folks do use Unix Login as their MySQL login
●
For convenience only
●
Easily overridden
●
-u or –user option
●
MySQL user names can be upto 16 characters long
●
Passwords encrypted by own algorithm
●
Alternative character sets and collations supported
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6
You can create MySQL accounts in two ways:
By using statements intended for creating
accounts, such as CREATE USER or GRANT.
These statements cause the server to make
appropriate modifications to the grant tables.
By manipulating the MySQL grant tables directly
with statements such as INSERT, UPDATE, or 
DELETE.
The preferred method is to use account-creation
statements because they are more concise and
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7
Example of adding users
shell> mysql --user=root mysql
mysql> CREATE USER ‘joe'@'localhost'
IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO
‘joe'@'localhost' -> WITH GRANT OPTION;
mysql> CREATE USER ‘joe'@'%' IDENTIFIED
BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO
‘joe'@'%' -> WITH GRANT OPTION;
mysql> CREATE USER 'admin'@'localhost';
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.8
When Joe is not Joe
‘joe’@’localhost’ may or not have the same
permissions as ‘joe’@’168.10.%’
Usually discovery of this occurs at worst possible
times
Network reconfiguration can cause problems
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9
Anonymous Accounts
 Mysql.user User column is blank
– Generally a bad idea
– Often used
Click to edit Master text styles
Second level
Third level
Fourth level
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10
So now we know mysql.user has user, host &
password – what else is in there
 Privileges
– Select, Insert, Update, Delete, Create, Drop, Reload, Shutdown, Process, File,
Grant, References, Index, Alter, Show, Super, Create_tmp_table, Lock_tables,
Execute, Repl_slave, Repl_client, Create_view, Show_view, Create_routine,
Alter_routine, Create_user, Event, Trigger, Create_tablespace
 Encryption
– SSL_type, SSL_cipher, x509_issuer, X509_subject
 Limits
– Max_questions, Max_updates, Max_connections, Max_user_connections
 New
– Plugin, authentication_string, password_expired
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.11
Plugins -- 6.3.7. Pluggable Authentication
 When a client connects to the MySQL server, the
server uses the user name provided by the client
and the client host to select the appropriate
account row from the mysql.user table. It then
uses this row to authenticate the client.
 In MySQL 5.6, the server authenticates clients
using plugins, as follows:
 The server determines from the account row which
authentication plugin applies for the client:
 If the account row specifies no plugin name, the
server uses native authentication.
 If the account row specifies a plugin, the server
invokes it to authenticate the user. If the server
cannot find the plugin, an error occurs.
 The plugin returns a status to the server indicating
whether the user is permitted to connect.
 Pluggable authentication enables two important
capabilities:
 External authentication: Pluggable authentication
makes it possible for clients to connect to the
MySQL server with credentials that are appropriate
for authentication methods other than native
authentication based on passwords stored in
the mysql.user table. For example, plugins can be
created to use external authentication methods
such as PAM, Windows login IDs, LDAP, or
Kerberos.
 Proxy users: If a user is permitted to connect, an
authentication plugin can return to the server a
user name different from the name of the
connecting user, to indicate that the connecting
user is a proxy for another user. While the
connection lasts, the proxy user is treated, for
purposes of access control, as having the
privileges of a different user. In effect, one user
impersonates another. 
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.12
Plugins available
Native
SHA-256
Cleartext
Socket Peer
Test
Enterprise Edition
– PAM
– Windows
– Audit
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13
Proxy Users
 When authentication to the MySQL server
occurs by means of an authentication
plugin, the plugin may request that the
connecting (external) user be treated as a
different user for privilege-checking
purposes. This enables the external user to
be a proxy for the second user; that is, to
have the privileges of the second user. In
other words, the external user is a “proxy
user” (a user who can impersonate or
become known as another user) and the
second user is a “proxied user” (a user
whose identity can be taken on by a proxy
user).
CREATE USER
'empl_external'@'localhost'
IDENTIFIED WITH auth_plugin
AS 'auth_string'; CREATE USER
'employee'@'localhost'
IDENTIFIED BY
'employee_pass'; GRANT
PROXY ON
'employee'@'localhost' TO
'empl_external'@'localhost';
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14
Other controls
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15
Examples of table/column permissions
 GRANT ALL ON mydb.mytbl TO 'someuser'@'somehost';
 GRANT SELECT, INSERT ON mydb.mytbl TO
'someuser'@'somehost';FLUSH PRIVILEGES
 GRANT SELECT (col1), INSERT (col1,col2) ON
mydb.mytbl TO 'someuser'@'somehost';
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.16
Do not forget that changes require …
FLUSH PRIVILEGES
Data in memory requires a reload after changes
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.17
Slide to check if audience is still awake
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.18
MySQL Predetermined Roles
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.19
●
Error on the side of too few than too many
●
Grant, Super, and Process privs are dangerous
●
Temp files can fill up disk drives, SANs
●
Shutdown priv can get very messy
●
Consider audit vaule.
First Rule on handing out privs
Be Stingy!!!
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.20
●
Look for who has Grant, File, Shutdown, Drop,
Create User, Create Index, Create Temp Files,
Alter and Event
●
Do you TRUST them
●
Are they worth a job/vacation/weekend/evening
●
Do you HAVE TO trust them
●
Triggers, logs, and Backups can be your friend
●
Setup replication accordingly
●
Time Delay
●
Certain Schemas /tables
●
Paranoia is not necessarily bad
Second Rule
Audit the privs
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.21
MySQL User Administration Tips & Tricks: Summary
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.22
 Optimized for Web, Cloud-based, Embedded use cases
 Simplified, Pluggable architecture
– Maintainability, more extensible
– More NoSQL options (HTTP, JSON, JavaScript, etc.)
 Refactoring
– Data Dictionary in InnoDB
– Optimizer/Parser/Protocol
 InnoDB
– Optimized for SSD
– GIS
 Easy HA, Replication and Sharding
MySQL Database Development Priorities
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.23
 mysql.com
●
MySQL Products, Editions, Training, Consulting
●
TCO calculator
●
Customer use cases and success stories
 dev.mysql.com
●
Downloads, Documentation
●
Forums
- PlanetMySQL
 eDelivery.oracle.com
●
Download and evaluate all MySQL products
Learn More
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.24
New MySQL 5.6 Training
Learn about the world’s most popular open-source database
oracle.com/education/mysql
Learn MySQL From Oracle
●
Expert-led training to help you
install, configure, and administer
MySQL 5.6.
●
Extensive hands-on practices
guide you through each concept
●
Explore real-world problems and
discover best practices as you
work with the tools and
techniques used by professional
MySQL database administrators
●
Content developed in
collaboration with product
engineering.
• Available in traditional or virtual
classroom as well as self-study
formats.
• Custom training solutions to match
your organization’s specific business
needs
• Backed by Oracle University’s 100%
Satisfaction Program
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.25
MySQL Connect
MySQL Engineers, Twitter,
Percona, Google, Facebook,
Tumblr, Paypal, Census
Bureau, Ticketmaster,
Amazon, Verizon, Codership
and more presenting
 September 21st – 23rd
 San Francisco Union Square
Hotel
 Learn from the best
– Customers
 Tutorials on Advanced
Subjects
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.26
MySQL Marinate! -- Great way to learn MySQL
 Virtual self-study of MySQL through the Boston MySQL Users Group
(http://www.meetup.com/mysqlbos/)
 http://www.meetup.com/Virtual-Tech-Self-Study/events/84103332/
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.27
Questions?
MySQL User Administration
Tips & Tricks
David.Stokes@Oracle.com
@stoker
slideshare.net/davestokes

Más contenido relacionado

La actualidad más candente

MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014
Dave Stokes
 
What's new in my sql smug
What's new in my sql smugWhat's new in my sql smug
What's new in my sql smug
Ted Wennmark
 
Introduction to MySQL Enterprise Monitor
Introduction to MySQL Enterprise MonitorIntroduction to MySQL Enterprise Monitor
Introduction to MySQL Enterprise Monitor
Mark Leith
 

La actualidad más candente (20)

MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014
 
MySQL Enterprise Monitor
MySQL Enterprise MonitorMySQL Enterprise Monitor
MySQL Enterprise Monitor
 
MySQL 5.6, news in 5.7 and our HA options
MySQL 5.6, news in 5.7 and our HA optionsMySQL 5.6, news in 5.7 and our HA options
MySQL 5.6, news in 5.7 and our HA options
 
MySQL Enterprise Backup apr 2016
MySQL Enterprise Backup apr 2016MySQL Enterprise Backup apr 2016
MySQL Enterprise Backup apr 2016
 
Introduction to MySQL
Introduction to MySQLIntroduction to MySQL
Introduction to MySQL
 
MySQL Monitoring 101
MySQL Monitoring 101MySQL Monitoring 101
MySQL Monitoring 101
 
What's new in my sql smug
What's new in my sql smugWhat's new in my sql smug
What's new in my sql smug
 
MySQL Performance Best Practices
MySQL Performance Best PracticesMySQL Performance Best Practices
MySQL Performance Best Practices
 
The MySQL SYS Schema
The MySQL SYS SchemaThe MySQL SYS Schema
The MySQL SYS Schema
 
Introduction to MySQL Enterprise Monitor
Introduction to MySQL Enterprise MonitorIntroduction to MySQL Enterprise Monitor
Introduction to MySQL Enterprise Monitor
 
MySQL Security
MySQL SecurityMySQL Security
MySQL Security
 
MySQL 5.7 Replication News
MySQL 5.7 Replication News MySQL 5.7 Replication News
MySQL 5.7 Replication News
 
NoSQL and MySQL
NoSQL and MySQLNoSQL and MySQL
NoSQL and MySQL
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7
 
Performance schema and sys schema
Performance schema and sys schemaPerformance schema and sys schema
Performance schema and sys schema
 
Welcome to MySQL
Welcome to MySQLWelcome to MySQL
Welcome to MySQL
 
MySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersMySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and Developers
 
MySQL sys schema deep dive
MySQL sys schema deep diveMySQL sys schema deep dive
MySQL sys schema deep dive
 
MySQL 5.7: Performance Schema Improvements
MySQL 5.7: Performance Schema ImprovementsMySQL 5.7: Performance Schema Improvements
MySQL 5.7: Performance Schema Improvements
 
TWJUG August, MySQL JDBC Driver "Connector/J"
TWJUG August, MySQL JDBC Driver "Connector/J"TWJUG August, MySQL JDBC Driver "Connector/J"
TWJUG August, MySQL JDBC Driver "Connector/J"
 

Similar a Southeast Linuxfest -- MySQL User Admin Tips & Tricks

Mysql tutorial-excerpt-5.1-en
Mysql tutorial-excerpt-5.1-enMysql tutorial-excerpt-5.1-en
Mysql tutorial-excerpt-5.1-en
chadambrosius
 
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best PracticesOracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Sven Sandberg
 
Don't be tardy configure password expiration with open sso and identity mana...
Don't be tardy  configure password expiration with open sso and identity mana...Don't be tardy  configure password expiration with open sso and identity mana...
Don't be tardy configure password expiration with open sso and identity mana...
Jose R
 

Similar a Southeast Linuxfest -- MySQL User Admin Tips & Tricks (20)

MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015
 
2014 OpenSuse Conf: Protect your MySQL Server
2014 OpenSuse Conf: Protect your MySQL Server2014 OpenSuse Conf: Protect your MySQL Server
2014 OpenSuse Conf: Protect your MySQL Server
 
Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101
 
RESTful Services for your Oracle Autonomous Database
RESTful Services for your Oracle Autonomous DatabaseRESTful Services for your Oracle Autonomous Database
RESTful Services for your Oracle Autonomous Database
 
MySQL Quick Dive
MySQL Quick DiveMySQL Quick Dive
MySQL Quick Dive
 
common_schema 2.2: DBA's framework for MySQL (April 2014)
common_schema 2.2: DBA's framework for MySQL (April 2014)common_schema 2.2: DBA's framework for MySQL (April 2014)
common_schema 2.2: DBA's framework for MySQL (April 2014)
 
Fortress SQL Server
Fortress SQL ServerFortress SQL Server
Fortress SQL Server
 
Mysql tutorial-excerpt-5.1-en
Mysql tutorial-excerpt-5.1-enMysql tutorial-excerpt-5.1-en
Mysql tutorial-excerpt-5.1-en
 
MySQL Proxy. A powerful, flexible MySQL toolbox.
MySQL Proxy. A powerful, flexible MySQL toolbox.MySQL Proxy. A powerful, flexible MySQL toolbox.
MySQL Proxy. A powerful, flexible MySQL toolbox.
 
Introduction to MariaDb
Introduction to MariaDbIntroduction to MariaDb
Introduction to MariaDb
 
Hacking Zy Xel Gateways
Hacking Zy Xel GatewaysHacking Zy Xel Gateways
Hacking Zy Xel Gateways
 
common_schema, DBA's framework for MySQL
common_schema, DBA's framework for MySQLcommon_schema, DBA's framework for MySQL
common_schema, DBA's framework for MySQL
 
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best PracticesOracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
 
Better access control of administrators
Better access control of administratorsBetter access control of administrators
Better access control of administrators
 
Don't be tardy configure password expiration with open sso and identity mana...
Don't be tardy  configure password expiration with open sso and identity mana...Don't be tardy  configure password expiration with open sso and identity mana...
Don't be tardy configure password expiration with open sso and identity mana...
 
common_schema 2.0: DBA's Framework for MySQL
common_schema 2.0: DBA's Framework for MySQLcommon_schema 2.0: DBA's Framework for MySQL
common_schema 2.0: DBA's Framework for MySQL
 
Global Azure Bootcamp 2018 - Oh no my organization went Azure
Global Azure Bootcamp 2018 - Oh no my organization went AzureGlobal Azure Bootcamp 2018 - Oh no my organization went Azure
Global Azure Bootcamp 2018 - Oh no my organization went Azure
 
Squid
SquidSquid
Squid
 
Moodle + Adobe Connect
Moodle + Adobe Connect Moodle + Adobe Connect
Moodle + Adobe Connect
 
Java API for WebSocket 1.0: Java EE 7 and GlassFish
Java API for WebSocket 1.0: Java EE 7 and GlassFishJava API for WebSocket 1.0: Java EE 7 and GlassFish
Java API for WebSocket 1.0: Java EE 7 and GlassFish
 

Más de Dave Stokes

Más de Dave Stokes (20)

Json within a relational database
Json within a relational databaseJson within a relational database
Json within a relational database
 
Database basics for new-ish developers -- All Things Open October 18th 2021
Database basics for new-ish developers  -- All Things Open October 18th 2021Database basics for new-ish developers  -- All Things Open October 18th 2021
Database basics for new-ish developers -- All Things Open October 18th 2021
 
Php & my sql - how do pdo, mysq-li, and x devapi do what they do
Php & my sql  - how do pdo, mysq-li, and x devapi do what they doPhp & my sql  - how do pdo, mysq-li, and x devapi do what they do
Php & my sql - how do pdo, mysq-li, and x devapi do what they do
 
Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...
Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...
Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...
 
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source SummitMySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
 
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScriptJavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
 
Open Source World June '21 -- JSON Within a Relational Database
Open Source World June '21 -- JSON Within a Relational DatabaseOpen Source World June '21 -- JSON Within a Relational Database
Open Source World June '21 -- JSON Within a Relational Database
 
Dutch PHP Conference 2021 - MySQL Indexes and Histograms
Dutch PHP Conference 2021 - MySQL Indexes and HistogramsDutch PHP Conference 2021 - MySQL Indexes and Histograms
Dutch PHP Conference 2021 - MySQL Indexes and Histograms
 
Validating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentationValidating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentation
 
Midwest PHP Presentation - New MSQL Features
Midwest PHP Presentation - New MSQL FeaturesMidwest PHP Presentation - New MSQL Features
Midwest PHP Presentation - New MSQL Features
 
Data Love Conference - Window Functions for Database Analytics
Data Love Conference - Window Functions for Database AnalyticsData Love Conference - Window Functions for Database Analytics
Data Love Conference - Window Functions for Database Analytics
 
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
 
Confoo 2021 -- MySQL New Features
Confoo 2021 -- MySQL New FeaturesConfoo 2021 -- MySQL New Features
Confoo 2021 -- MySQL New Features
 
Confoo 2021 - MySQL Indexes & Histograms
Confoo 2021 - MySQL Indexes & HistogramsConfoo 2021 - MySQL Indexes & Histograms
Confoo 2021 - MySQL Indexes & Histograms
 
Datacon LA - MySQL without the SQL - Oh my!
Datacon LA - MySQL without the SQL - Oh my! Datacon LA - MySQL without the SQL - Oh my!
Datacon LA - MySQL without the SQL - Oh my!
 
MySQL Replication Update - DEbconf 2020 presentation
MySQL Replication Update - DEbconf 2020 presentationMySQL Replication Update - DEbconf 2020 presentation
MySQL Replication Update - DEbconf 2020 presentation
 
MySQL 8.0 Operational Changes
MySQL 8.0 Operational ChangesMySQL 8.0 Operational Changes
MySQL 8.0 Operational Changes
 
cPanel now supports MySQL 8.0 - My Top Seven Features
cPanel now supports MySQL 8.0 - My Top Seven FeaturescPanel now supports MySQL 8.0 - My Top Seven Features
cPanel now supports MySQL 8.0 - My Top Seven Features
 
A Step by Step Introduction to the MySQL Document Store
A Step by Step Introduction to the MySQL Document StoreA Step by Step Introduction to the MySQL Document Store
A Step by Step Introduction to the MySQL Document Store
 
Discover The Power of NoSQL + MySQL with MySQL
Discover The Power of NoSQL + MySQL with MySQLDiscover The Power of NoSQL + MySQL with MySQL
Discover The Power of NoSQL + MySQL with MySQL
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Southeast Linuxfest -- MySQL User Admin Tips & Tricks

  • 1. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1 Dave Stokes MySQL Community Manager David.Stokes@oracle.com @Stoker MySQL User Administration Tips & Tricks
  • 2. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.2 The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decision. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Safe Harbor Statement
  • 3. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4 MySQL Manual 6.3.1. User Names and Passwords MySQL stores accounts in the user  table of the mysql database. An account is defined in terms of a user name and the client host or hosts from which the user can connect to the server. The account may also have a password. Thus speaketh the manual
  • 4. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5 MySQL login ≠ User Login • Many folks do use Unix Login as their MySQL login ● For convenience only ● Easily overridden ● -u or –user option ● MySQL user names can be upto 16 characters long ● Passwords encrypted by own algorithm ● Alternative character sets and collations supported
  • 5. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6 You can create MySQL accounts in two ways: By using statements intended for creating accounts, such as CREATE USER or GRANT. These statements cause the server to make appropriate modifications to the grant tables. By manipulating the MySQL grant tables directly with statements such as INSERT, UPDATE, or  DELETE. The preferred method is to use account-creation statements because they are more concise and
  • 6. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7 Example of adding users shell> mysql --user=root mysql mysql> CREATE USER ‘joe'@'localhost' IDENTIFIED BY 'some_pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO ‘joe'@'localhost' -> WITH GRANT OPTION; mysql> CREATE USER ‘joe'@'%' IDENTIFIED BY 'some_pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO ‘joe'@'%' -> WITH GRANT OPTION; mysql> CREATE USER 'admin'@'localhost';
  • 7. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.8 When Joe is not Joe ‘joe’@’localhost’ may or not have the same permissions as ‘joe’@’168.10.%’ Usually discovery of this occurs at worst possible times Network reconfiguration can cause problems
  • 8. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9 Anonymous Accounts  Mysql.user User column is blank – Generally a bad idea – Often used Click to edit Master text styles Second level Third level Fourth level
  • 9. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10 So now we know mysql.user has user, host & password – what else is in there  Privileges – Select, Insert, Update, Delete, Create, Drop, Reload, Shutdown, Process, File, Grant, References, Index, Alter, Show, Super, Create_tmp_table, Lock_tables, Execute, Repl_slave, Repl_client, Create_view, Show_view, Create_routine, Alter_routine, Create_user, Event, Trigger, Create_tablespace  Encryption – SSL_type, SSL_cipher, x509_issuer, X509_subject  Limits – Max_questions, Max_updates, Max_connections, Max_user_connections  New – Plugin, authentication_string, password_expired
  • 10. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.11 Plugins -- 6.3.7. Pluggable Authentication  When a client connects to the MySQL server, the server uses the user name provided by the client and the client host to select the appropriate account row from the mysql.user table. It then uses this row to authenticate the client.  In MySQL 5.6, the server authenticates clients using plugins, as follows:  The server determines from the account row which authentication plugin applies for the client:  If the account row specifies no plugin name, the server uses native authentication.  If the account row specifies a plugin, the server invokes it to authenticate the user. If the server cannot find the plugin, an error occurs.  The plugin returns a status to the server indicating whether the user is permitted to connect.  Pluggable authentication enables two important capabilities:  External authentication: Pluggable authentication makes it possible for clients to connect to the MySQL server with credentials that are appropriate for authentication methods other than native authentication based on passwords stored in the mysql.user table. For example, plugins can be created to use external authentication methods such as PAM, Windows login IDs, LDAP, or Kerberos.  Proxy users: If a user is permitted to connect, an authentication plugin can return to the server a user name different from the name of the connecting user, to indicate that the connecting user is a proxy for another user. While the connection lasts, the proxy user is treated, for purposes of access control, as having the privileges of a different user. In effect, one user impersonates another. 
  • 11. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.12 Plugins available Native SHA-256 Cleartext Socket Peer Test Enterprise Edition – PAM – Windows – Audit
  • 12. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13 Proxy Users  When authentication to the MySQL server occurs by means of an authentication plugin, the plugin may request that the connecting (external) user be treated as a different user for privilege-checking purposes. This enables the external user to be a proxy for the second user; that is, to have the privileges of the second user. In other words, the external user is a “proxy user” (a user who can impersonate or become known as another user) and the second user is a “proxied user” (a user whose identity can be taken on by a proxy user). CREATE USER 'empl_external'@'localhost' IDENTIFIED WITH auth_plugin AS 'auth_string'; CREATE USER 'employee'@'localhost' IDENTIFIED BY 'employee_pass'; GRANT PROXY ON 'employee'@'localhost' TO 'empl_external'@'localhost';
  • 13. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14 Other controls
  • 14. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15 Examples of table/column permissions  GRANT ALL ON mydb.mytbl TO 'someuser'@'somehost';  GRANT SELECT, INSERT ON mydb.mytbl TO 'someuser'@'somehost';FLUSH PRIVILEGES  GRANT SELECT (col1), INSERT (col1,col2) ON mydb.mytbl TO 'someuser'@'somehost';
  • 15. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.16 Do not forget that changes require … FLUSH PRIVILEGES Data in memory requires a reload after changes
  • 16. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.17 Slide to check if audience is still awake
  • 17. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.18 MySQL Predetermined Roles
  • 18. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.19 ● Error on the side of too few than too many ● Grant, Super, and Process privs are dangerous ● Temp files can fill up disk drives, SANs ● Shutdown priv can get very messy ● Consider audit vaule. First Rule on handing out privs Be Stingy!!!
  • 19. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.20 ● Look for who has Grant, File, Shutdown, Drop, Create User, Create Index, Create Temp Files, Alter and Event ● Do you TRUST them ● Are they worth a job/vacation/weekend/evening ● Do you HAVE TO trust them ● Triggers, logs, and Backups can be your friend ● Setup replication accordingly ● Time Delay ● Certain Schemas /tables ● Paranoia is not necessarily bad Second Rule Audit the privs
  • 20. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.21 MySQL User Administration Tips & Tricks: Summary
  • 21. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.22  Optimized for Web, Cloud-based, Embedded use cases  Simplified, Pluggable architecture – Maintainability, more extensible – More NoSQL options (HTTP, JSON, JavaScript, etc.)  Refactoring – Data Dictionary in InnoDB – Optimizer/Parser/Protocol  InnoDB – Optimized for SSD – GIS  Easy HA, Replication and Sharding MySQL Database Development Priorities
  • 22. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.23  mysql.com ● MySQL Products, Editions, Training, Consulting ● TCO calculator ● Customer use cases and success stories  dev.mysql.com ● Downloads, Documentation ● Forums - PlanetMySQL  eDelivery.oracle.com ● Download and evaluate all MySQL products Learn More
  • 23. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.24 New MySQL 5.6 Training Learn about the world’s most popular open-source database oracle.com/education/mysql Learn MySQL From Oracle ● Expert-led training to help you install, configure, and administer MySQL 5.6. ● Extensive hands-on practices guide you through each concept ● Explore real-world problems and discover best practices as you work with the tools and techniques used by professional MySQL database administrators ● Content developed in collaboration with product engineering. • Available in traditional or virtual classroom as well as self-study formats. • Custom training solutions to match your organization’s specific business needs • Backed by Oracle University’s 100% Satisfaction Program
  • 24. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.25 MySQL Connect MySQL Engineers, Twitter, Percona, Google, Facebook, Tumblr, Paypal, Census Bureau, Ticketmaster, Amazon, Verizon, Codership and more presenting  September 21st – 23rd  San Francisco Union Square Hotel  Learn from the best – Customers  Tutorials on Advanced Subjects
  • 25. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.26 MySQL Marinate! -- Great way to learn MySQL  Virtual self-study of MySQL through the Boston MySQL Users Group (http://www.meetup.com/mysqlbos/)  http://www.meetup.com/Virtual-Tech-Self-Study/events/84103332/
  • 26. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.27 Questions? MySQL User Administration Tips & Tricks David.Stokes@Oracle.com @stoker slideshare.net/davestokes