• EnglishSpanishGermanFrenchPolishChinese (Traditional)


EnglishSpanishGermanFrenchPolishChinese (Traditional)

Operating systems, scripting, PowerShell and security

Operating systems, software development, scripting, PowerShell tips, network and security

Menú principal
  • Categorías
  • Cursos
  • Libro de PowerShell
  • Lo mejor
  • Lo último
  • Proyectos
  • Contactar
Ir al contenido

Crear una base de datos en MySQL con PowerShell

PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
[void][System.Reflection.Assembly]::LoadWithPartialName("MySql.Data")
$Connection = New-Object MySql.Data.MySqlClient.MySqlConnection
$ConnectionString = "server=" + "localhost" + ";port=3306;uid=" + "root" + ";pwd=" + ";"
$Connection.ConnectionString = $ConnectionString
$Connection.Open()
 
$Query = 'CREATE database Users'
$Command = New-Object MySql.Data.MySqlClient.MySqlCommand($Query, $Connection)
$DataAdapter = New-Object MySql.Data.MySqlClient.MySqlDataAdapter($Command)
$DataSet = New-Object System.Data.DataSet
$RecordCount = $dataAdapter.Fill($dataSet, "data")
$DataSet.Tables[0]
$Connection.Close()

Publicado el día 11 de enero de 2017

CATEGORÍAS

Bases de datos, PowerShell

ETIQUETAS

Connection, data, Jesús Niño Camazón, LoadWithPartialName, MySQL, MySQL con PowerShell, New-Object, pwd, Reflection.Assembly, Server, System.Reflection.Assembly

MÁS

  • Crear formulario dentro de otro formulario mediante una función con PowerShell
  • Ejercicios de PowerShell: simula un login, ten en cuenta que el password se encuentra en SHA512
  • Crear, compilar y ejecutar una DLL con Microsoft Visual C# que ejecute un cmdlet de PowerShell
  • Utilizar Firebase en App Inventor
  • Crear, compilar y ejecutar una DLL con Microsoft Visual C# que crear un usuario desde PowerShell
  • Buscar el nombre de una clase de un formulario en PowerShell con Microsoft Spy++ y escribir un mensaje en una caja de texto desde PowerShell