Restore Innodb MySQL data

Today I am trying to get the data from MySQL Innodb type but it failed to get the data when I directly dump it from the server as it is crashed.

Somehow, I am trying to get the data from the backup available from the offline server which come with physical file only and this is the reason I need to setup another fresh MySQL database to get the data.

To done it, you may follow the step as below.
1. Restore the database table data with the database name and ibdata[number].
eg. database folder and ibdata1 file.
2. Copy these folder and file to the database server.
3. Dump the database with the mysqldump command.
mysqldump [database_name] > database.sql

During the restoration, I’m actually getting error as below.
======================
[ERROR] Plugin ‘InnoDB’ init function returned error.
[ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported table type: INNODB
[ERROR] Aborting
======================

With the above error, it is because I have restored the ib_logfile[number] file too. To fix it, simply remove all file named ib_logfile[number].

Connect ASP.Net script with MySQL

It is very easy if you have ASP.Net script and want to connect to MySQL databases.

Today, Mick Genie will share how to connect your MySQL database with your ASP.Net script.

Sample Code:
==========
<%@ Page Language=”VB” debug=”true” %>
<%@ Import Namespace = “System.Data” %>
<%@ Import Namespace = “MySql.Data.MySqlClient” %>
<script language=”VB” runat=”server”>

Sub Page_Load(sender As Object, e As EventArgs)

Dim myConnection  As MySqlConnection
Dim myDataAdapter As MySqlDataAdapter
Dim myDataSet     As DataSet

Dim strSQL        As String
Dim iRecordCount  As Integer

myConnection = New MySqlConnection(“server=localhost; user id=mickgenie; password=password; database=database;”)

strSQL = “SELECT * FROM mytable;”

myDataAdapter = New MySqlDataAdapter(strSQL, myConnection)
myDataSet = New Dataset()
myDataAdapter.Fill(myDataSet, “mytable”)

MySQLDataGrid.DataSource = myDataSet
MySQLDataGrid.DataBind()

End Sub

</script>

<html>
<head>
<title>Simple MySQL Database Query</title>
</head>
<body>

<form runat=”server”>

<asp:DataGrid id=”MySQLDataGrid” runat=”server” />

</form>

</body>
</html>
==========

From the above code, you may change the setting from myConnection and you shall be able to connect without any problem.