Skip to content
Iampsp Blog

Iampsp Blog

I am a programming service provider

My Portfolio
Project order
Reviews
Favorite Exchange

Categories

  • C
  • C#
  • C++
  • CSS
  • Firefox Addons
  • Firefox Themes
  • Gaming
  • HTML
  • JAVA
  • JavaScript
  • jQuery
  • Mybb Plugins
  • MySQL
  • PHP
  • Python
  • React
  • SQL
  • Web Services
  • XML

Recent Posts

  • Top 6 Best Minecraft Server Hosting Options in 2025
  • Top 15 Most Popular Google Doodle Games in 2025
  • Top 11 IRC Clients for Windows, macOS, and Linux in 2025
  • Top 10 Open Source Video Games in 2025
  • Top 10 Free Image Hosting Services for 2025

MySQL LOG Function

Example

Return the natural logarithm of 2:

SELECT LOG(2);

Definition and Usage

The LOG() function returns the natural logarithm of a specified number, or the logarithm of the number to the specified base.

Syntax

LOG(number)

OR :

LOG(base, number)

Parameter Values

Parameter Description
number Required. A number. Must be greater than 0
base The base of number. Must be greater than 1

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Return the natural logarithm of 4 to a specified base (2):

SELECT LOG(2, 4);
Posted on 2025-03-11Author MostafaCategories SQLTags mysql command line, mysql count, mysql create user, mysql database, mysql docker, mysql download, mysql insert into, mysql log all queries, mysql log file location linux, mysql log file location windows, mysql log in, mysql log in as root, mysql log level, mysql log location linux, mysql log rotate, mysql log shipping, mysql log slow queries, mysql port, mysql row_number, mysql workbench

Post navigation

Previous Previous post: MySQL LN Function
Next Next post: MySQL LOG10 Function
Proudly powered by WordPress